Kebechet.Maui.MicrosoftClarity 4.0.0

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

"Buy Me A Coffee"

Maui.MicrosoftClarity

NuGet Version NuGet Downloads Last updated (main) Twitter

Wrapper for Microsoft Clarity for mobile

Usage

Firstly register package installer in your MauiProgram.cs

 builder.Services.AddMicrosoftClarity();

then in App.xaml.cs inject IMicrosoftClarityService:

public partial class App : Application {
    private readonly IMicrosoftClarityService _microsoftClarityService;

    public App(IMicrosoftClarityService microsoftClarityService) {
        InitializeComponent();
        _microsoftClarityService = microsoftClarityService;
    }
}

and also override there method OnStart() to call _microsoftClarityService.Initialize with your project id.

protected override void OnStart() {
    _microsoftClarityService.Initialize("<MicrosoftClarityProjectIdHere>");

    base.OnStart();
}

⚠️ iOS Local debugging

Because of MAUI and VS bugs:

it is not possible to run your app with hot-restart(direct local iOS deploy from VS for Windows)

Dummy classes

So that you dont have to specify platform for this package and it's calls, also Windows and MacCatalyst are added with dummy implementations. When you call one of their methods you will always get:

  • true for bool returns
  • new List<> for collections
  • string.Empty for string values

Exception behavior

  • Library will throw exceptions only in case developer did some mistake
  • in other cases, when there is some corrupted state it will return default value of that type.

Automated SDK updates

This repo runs a daily pipeline that watches Microsoft's Clarity Android and iOS SDKs and tries to bump + re-wire this package automatically. The flow:

flowchart TD
    A[Microsoft ships new Clarity SDK] --> B[06:00 UTC daily<br/>automatic-detect-sdk-updates.yml]
    B --> C[Bump PR opened<br/>label: auto-bump]
    C --> D[automatic-bump-and-wire.yml:<br/>build binding + diff API + build wrapper]

    D --> E{Outcome?}

    E -->|API unchanged<br/>wrapper compiles| F[Auto-merge as<br/>stable release]
    E -->|API additions<br/>or wrapper breaks| G[Label: needs-wiring<br/>Ping @copilot<br/>with API diff]
    E -->|Binding itself broken| H[Label: binding-broken<br/>Ping @copilot<br/>with binding-fix guide]

    G --> K[Agent commits wiring]
    H --> L{Agent can fix?}
    L -->|yes| K
    L -->|no| M[Agent adds label:<br/>needs-human]

    K --> N[Human review + merge]
    M --> N
    F --> O[main updated]
    N --> O

    O --> R[release-please<br/>maintains release PR<br/>for wrapper version]
    R --> S[Merge release PR<br/>tags vX.Y.Z]
    S --> T[Manually run<br/>publish-*.yml workflows]
    T --> U[NuGet.org]

    classDef happy fill:#d4edda,stroke:#155724,color:#000
    classDef warn fill:#fff3cd,stroke:#856404,color:#000
    classDef human fill:#f8d7da,stroke:#721c24,color:#000
    class F,O,U happy
    class G,H,K warn
    class M,N human

The only manual steps for you:

  1. Review and merge agent wiring PRs when needs-wiring is applied
  2. Fix binding-generator failures the agent escalates as needs-human (rare)
  3. Trigger the three publish-*.yml workflows after each release tag

See .github/COPILOT_INSTRUCTIONS.md for the rules the agent follows.

Contributions

Feel free to create an issue or pull request. In case you would like to do massive changes in the package please firstly discuss them in the issue because otherwise there is high chance that such big PR would be rejected.

License

This repository is licensed with the MIT license.

Product Compatible and additional computed target framework versions.
.NET net10.0-android36.0 is compatible.  net10.0-ios26.0 is compatible.  net10.0-maccatalyst26.0 is compatible.  net10.0-windows10.0.19041 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
4.0.0 125 5/12/2026
3.0.2 101 5/12/2026
3.0.1 221 3/26/2026
3.0.0 738 2/7/2026
2.1.0 930 10/11/2025
2.0.0 4,698 4/15/2025
1.0.8 1,874 12/16/2024
1.0.7 245 11/30/2024
1.0.6 289 11/19/2024
1.0.5 315 9/10/2024
1.0.4 212 9/6/2024
1.0.3 246 8/15/2024
1.0.2 223 8/7/2024
1.0.1 213 7/15/2024
1.0.0 206 7/15/2024

Fixed Android memory leak: properly dispose SessionStartedCallbackAdapter Java interop objects