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
<PackageReference Include="Soenneker.Blazor.Clarity" Version="11.0.2336" />
<PackageVersion Include="Soenneker.Blazor.Clarity" Version="11.0.2336" />
<PackageReference Include="Soenneker.Blazor.Clarity" />
paket add Soenneker.Blazor.Clarity --version 11.0.2336
#r "nuget: Soenneker.Blazor.Clarity, 11.0.2336"
#:package Soenneker.Blazor.Clarity@11.0.2336
#addin nuget:?package=Soenneker.Blazor.Clarity&version=11.0.2336
#tool nuget:?package=Soenneker.Blazor.Clarity&version=11.0.2336
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 with consent
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Asyncs.Initializers (>= 11.0.140)
- Soenneker.Blazor.Utils.ModuleImport (>= 11.0.1944)
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 |
Update dependency Soenneker.Gen.Web.Minifier to 11.0.70 (#3003)