Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soenneker/soenneker.blazor.clarity
A small Blazor interop library that sets up Microsoft Clarity
https://github.com/soenneker/soenneker.blazor.clarity
blazor clarity csharp dotnet interop
Last synced: 2 months ago
JSON representation
A small Blazor interop library that sets up Microsoft Clarity
- Host: GitHub
- URL: https://github.com/soenneker/soenneker.blazor.clarity
- Owner: soenneker
- License: mit
- Created: 2023-01-03T01:40:17.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T12:59:14.000Z (3 months ago)
- Last Synced: 2024-10-29T14:33:15.112Z (3 months ago)
- Topics: blazor, clarity, csharp, dotnet, interop
- Language: C#
- Homepage: https://soenneker.com
- Size: 374 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[![](https://img.shields.io/nuget/v/Soenneker.Blazor.Clarity.svg?style=for-the-badge)](https://www.nuget.org/packages/Soenneker.Blazor.Clarity/)
[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.blazor.clarity/publish-package.yml?style=for-the-badge)](https://github.com/soenneker/soenneker.blazor.clarity/actions/workflows/publish-package.yml)
[![](https://img.shields.io/nuget/dt/Soenneker.Blazor.Clarity.svg?style=for-the-badge)](https://www.nuget.org/packages/Soenneker.Blazor.Clarity/)# ![](https://user-images.githubusercontent.com/4441470/224455560-91ed3ee7-f510-4041-a8d2-3fc093025112.png) Soenneker.Blazor.Clarity
### A Blazor interop library that sets up [Microsoft Clarity](https://clarity.microsoft.com/)## Installation
```
dotnet add package Soenneker.Blazor.Clarity
```## Usage
1. Register the interop within DI (`Program.cs`)
```csharp
public static async Task Main(string[] args)
{
...
builder.Services.AddClarity();
}
```2. Inject `IClarityInterop` within your `App.Razor` file
```csharp
@using Soenneker.Blazor.Clarity.Abstract
@inject IClarityInterop ClarityInterop
```3. Initialize the interop in `OnInitializedAsync` within `App.Razor` using your Clarity project key
```csharp
protected override async Task OnInitializedAsync()
{
await ClarityInterop.Init("your-key-here");
...
}
```