Blazor.Permissions.WebAssembly
10.1.0
dotnet add package Blazor.Permissions.WebAssembly --version 10.1.0
NuGet\Install-Package Blazor.Permissions.WebAssembly -Version 10.1.0
<PackageReference Include="Blazor.Permissions.WebAssembly" Version="10.1.0" />
<PackageVersion Include="Blazor.Permissions.WebAssembly" Version="10.1.0" />
<PackageReference Include="Blazor.Permissions.WebAssembly" />
paket add Blazor.Permissions.WebAssembly --version 10.1.0
#r "nuget: Blazor.Permissions.WebAssembly, 10.1.0"
#:package Blazor.Permissions.WebAssembly@10.1.0
#addin nuget:?package=Blazor.Permissions.WebAssembly&version=10.1.0
#tool nuget:?package=Blazor.Permissions.WebAssembly&version=10.1.0
Blazorators: The Source Generated permissions JavaScript Interop library for Blazor WebAssembly
The Blazor.Permissions.WebAssembly package consumes the Blazor.SourceGenerators package. It exposes a source-generated IPermissionsService interface specific to Blazor WebAssembly and the permissions Web API.
Get started
After the NuGet package is added as a reference, call the AddPermissionsServices method to register the IPermissionsService service type.
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped(
sp => new HttpClient
{
BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)
});
builder.Services.AddPermissionsServices();
await builder.Build().RunAsync();
Anywhere needed within your Razor component, or Blazor client code — either @inject or [Inject] the IPermissionsService type. The interface takes the following shape:
#nullable enable
using System.Threading.Tasks;
namespace Microsoft.JSInterop;
/// <summary>
/// Source generated interface definition of the <c>Permissions</c> type.
/// </summary>
public interface IPermissionsService
{
/// <summary>
/// Source generated implementation of <c>window.navigator.permissions.query</c>.
/// <a href="https://developer.mozilla.org/docs/Web/API/Permissions/query"></a>
/// </summary>
ValueTask<PermissionStatus> QueryAsync(PermissionDescriptor permissionDesc);
}
Add JavaScript dependency
In the index.html file, add the following:
<script src="_content/Blazor.Permissions.WebAssembly/blazorators.permissions.g.js"></script>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 10.0.0)
- Microsoft.AspNetCore.Components.WebAssembly (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0)
- Microsoft.JSInterop (>= 10.0.0)
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.0)
- Microsoft.AspNetCore.Components.WebAssembly (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.JSInterop (>= 8.0.0)
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 9.0.0)
- Microsoft.AspNetCore.Components.WebAssembly (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection (>= 9.0.0)
- Microsoft.JSInterop (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.1.0 | 113 | 7/24/2026 |