Soenneker.Blazor.Clarity 11.0.2392

Prefix Reserved
dotnet add package Soenneker.Blazor.Clarity --version 11.0.2392
                    
NuGet\Install-Package Soenneker.Blazor.Clarity -Version 11.0.2392
                    
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.2392" />
                    
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.2392" />
                    
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.2392
                    
#r "nuget: Soenneker.Blazor.Clarity, 11.0.2392"
                    
#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.2392
                    
#: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.2392
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.Clarity&version=11.0.2392
                    
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.2392 90 12/3/2026
11.0.2391 71 12/3/2026
11.0.2390 73 12/3/2026
11.0.2389 99 12/3/2026
11.0.2388 76 12/3/2026
11.0.2387 75 12/3/2026
11.0.2386 72 12/3/2026
11.0.2385 77 12/3/2026
11.0.2384 80 12/3/2026
11.0.2383 79 12/2/2026
11.0.2382 75 12/2/2026
11.0.2381 91 12/2/2026
11.0.2379 84 12/2/2026
11.0.2378 107 12/2/2026
11.0.2377 80 12/2/2026
11.0.2376 88 12/2/2026
11.0.2375 88 12/2/2026
11.0.2374 88 12/2/2026
11.0.2373 94 12/1/2026
11.0.2372 87 12/1/2026
Loading failed

Updated Soenneker.Gen.Web.Minifier to 11.0.122