Soenneker.Blazor.C15t 11.0.157

Prefix Reserved
dotnet add package Soenneker.Blazor.C15t --version 11.0.157
                    
NuGet\Install-Package Soenneker.Blazor.C15t -Version 11.0.157
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Blazor.C15t" Version="11.0.157" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.C15t" Version="11.0.157" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.C15t" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Blazor.C15t --version 11.0.157
                    
#r "nuget: Soenneker.Blazor.C15t, 11.0.157"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Blazor.C15t@11.0.157
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Blazor.C15t&version=11.0.157
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.C15t&version=11.0.157
                    
Install as a Cake Tool

alternate text is missing from this package README image

Soenneker.Blazor.C15t

A Blazor wrapper around the c15t consent runtime, with scoped state, consent actions, and a cascading provider.

Installation

dotnet add package Soenneker.Blazor.C15t

Registration

using Soenneker.Blazor.C15t.Registrars;

builder.Services.AddC15t();

Wrap the application content with C15tProvider. It initializes after the first render, when JavaScript interop is available, and cascades IC15tConsentService to descendants.

@using Soenneker.Blazor.C15t
@using Soenneker.Blazor.C15t.Models

<C15tProvider Options="_options">
    <Router AppAssembly="@typeof(App).Assembly">
        ...
    </Router>
</C15tProvider>

@code {
    private readonly C15tOptions _options = new()
    {
        Mode = "offline",
        ConsentCategories =
        [
            "necessary",
            "functionality",
            "experience",
            "measurement",
            "marketing"
        ]
    };
}

The provider does not delay rendering its children. Code that loads analytics, marketing, or other optional resources must still check consent before running.

@using Soenneker.Blazor.C15t.Abstract
@inject IC15tConsentService Consent

<button @onclick="async () => await Consent.AcceptAll()">Accept all</button>
<button @onclick="async () => await Consent.RejectNonNecessary()">Necessary only</button>

@if (Consent.HasConsent("measurement"))
{
    <p>Analytics may be enabled.</p>
}

CurrentState is the last state returned by an operation through this scoped service. Refresh() reads the runtime again. For a custom preferences UI, call SetSelectedConsent(category, value) for each pending choice and then SaveCustom(); SetConsent() saves one category immediately.

AcceptAll(), RejectNonNecessary(), ResetConsents(), OpenDialog(), ShowBanner(), and CloseUi() all return the resulting state and update CurrentState.

Runtime options

  • With no backend URL, the wrapper selects offline mode.
  • BackendUrl and Mode configure a hosted or self-hosted c15t consent manager.
  • ConsentCategories is forwarded as c15t's initial GDPR categories.
  • ExtensionData forwards additional c15t options without requiring wrapper changes.
  • ModuleUrl defaults to the pinned c15t ESM package on jsDelivr. Relative same-origin URLs are supported for self-hosting.

The module URL must resolve to HTTPS, except for loopback HTTP development URLs. It is executable code: only configure a module location you control or explicitly trust. If a Content Security Policy is enabled, allow the selected module origin and any configured backend origin.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Blazor.C15t:

Package Downloads
Soenneker.Quark.Suite

Shadcn-powered Blazor UI, refined and modular.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.157 0 11/15/2026
11.0.156 42 11/14/2026
11.0.155 56 11/14/2026
11.0.154 1,015 11/12/2026
11.0.153 52 11/12/2026
11.0.152 235 11/12/2026
11.0.151 48 11/12/2026
11.0.150 160 11/11/2026
11.0.149 169 11/11/2026
11.0.148 139 11/11/2026
11.0.147 139 11/11/2026
11.0.146 140 11/11/2026
11.0.144 92 11/11/2026
11.0.143 187 11/11/2026
11.0.142 58 11/11/2026
11.0.141 204 11/11/2026
11.0.140 54 11/11/2026
11.0.139 50 11/11/2026
11.0.138 2,406 11/4/2026
11.0.137 61 11/4/2026
Loading failed

Update dependency Soenneker.Blazor.Utils.ResourceLoader to 11.0.1840 (#577)