Soenneker.Blazor.Clarity 11.0.2336

Prefix Reserved
dotnet add package Soenneker.Blazor.Clarity --version 11.0.2336
                    
NuGet\Install-Package Soenneker.Blazor.Clarity -Version 11.0.2336
                    
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.Clarity" Version="11.0.2336" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.Clarity" Version="11.0.2336" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.Clarity" />
                    
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.Clarity --version 11.0.2336
                    
#r "nuget: Soenneker.Blazor.Clarity, 11.0.2336"
                    
#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.Clarity@11.0.2336
                    
#: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.Clarity&version=11.0.2336
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.Clarity&version=11.0.2336
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Blazor.Clarity

Scoped Blazor JavaScript interop for Microsoft Clarity initialization, Consent V2, identification, tags, and custom events.

Installation and registration

dotnet add package Soenneker.Blazor.Clarity
using Soenneker.Blazor.Clarity.Registrars;

builder.Services.AddClarityInteropAsScoped();

Initialize after the first render, then immediately send the visitor's stored consent choices. Calls are queued by Clarity while its remote script loads.

@using Soenneker.Blazor.Clarity.Abstract
@inject IClarityInterop Clarity
@inject IConfiguration Configuration

@code {
    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (!firstRender)
            return;

        await Clarity.Init(Configuration["Clarity:ProjectId"]!);
        await Clarity.Consent(
            adStorage: marketingConsent,
            analyticsStorage: analyticsConsent);
    }
}

Call Consent again whenever either choice changes. Passing false denies the corresponding storage category and asks Clarity to clear applicable cookies. The wrapper requires Init before every other operation and prevents the same scoped instance from switching project IDs.

Identify, tag, and track

await Clarity.Identify(
    id: pseudonymousUserId,
    sessionId: sessionId,
    pageId: routeId,
    friendlyName: accountDisplayName);

await Clarity.SetTag("subscription", "business");
await Clarity.SetTag("experiments", new[] { "checkout-a", "nav-b" });
await Clarity.TrackEvent("checkout_completed");

Tag values must be a string or string array. Avoid sending email addresses, names, raw account IDs, or other directly identifying data as Clarity IDs, tags, event names, or friendly names; use pseudonymous values approved by your privacy policy.

The browser loads Clarity from https://www.clarity.ms. Configure Content Security Policy and consent gating for that origin before enabling the integration. Disposing the scoped interop releases the package's JavaScript module, but it does not unload a Clarity tracker already installed on the page.

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

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
11.0.2336 0 11/15/2026
11.0.2335 0 11/15/2026
11.0.2334 52 11/14/2026
11.0.2333 116 11/12/2026
11.0.2332 82 11/11/2026
11.0.2331 77 11/11/2026
11.0.2330 85 11/11/2026
11.0.2329 81 11/11/2026
11.0.2328 81 11/11/2026
11.0.2327 88 11/11/2026
11.0.2326 83 11/11/2026
11.0.2325 75 11/11/2026
11.0.2323 81 11/11/2026
11.0.2321 76 11/11/2026
11.0.2320 79 11/11/2026
11.0.2319 174 11/3/2026
11.0.2318 100 11/3/2026
11.0.2317 90 11/3/2026
11.0.2316 96 11/3/2026
11.0.2315 98 11/3/2026
Loading failed

Update dependency Soenneker.Gen.Web.Minifier to 11.0.70 (#3003)