ClerkWebhookExtensions 1.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package ClerkWebhookExtensions --version 1.0.0                
NuGet\Install-Package ClerkWebhookExtensions -Version 1.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="ClerkWebhookExtensions" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ClerkWebhookExtensions --version 1.0.0                
#r "nuget: ClerkWebhookExtensions, 1.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.
// Install ClerkWebhookExtensions as a Cake Addin
#addin nuget:?package=ClerkWebhookExtensions&version=1.0.0

// Install ClerkWebhookExtensions as a Cake Tool
#tool nuget:?package=ClerkWebhookExtensions&version=1.0.0                

ClerkWebhookExtension

Clerk webhook extension is a library for c# to help you create a webhook extension for clerk.com.

How to use

install the package

Install the package from nuget:


dotnet add package ClerkWebhookExtension

Create a class that implements the webhook interface:

using Vimatech.Clerk.Webhook

public class MyWebhookEvent : IWebhookEvent<UserCreated>
{
    public Task HandleAsync(UserCreated data, CancellationToken cancellationToken)
    {
        // Do something with the webhook event
    }
}

Register the webhook and validation

Register the webhook and validation in the service collection:

using Vimatech.Clerk.Webhook

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddClerk(webhookBuilder => {
    webhookBuilder.AddWebhook<UserCreated, MyWebhookEvent>()
        .AddValidation(new WebhookValidationOptions<UserCreated {
            SigninSecret = "signin-secret"
            });

    // Add more webhooks and validations here
});
 

Your signin secret can be found in the clerk dashboard under webhooks → endpoints → signin secret.

Notice that not using validation would be a security risk.

Add the middleware

Add the middleware to the request pipeline:

using Vimatech.Clerk.Webhook

app = WebApplication.Create(args);

app.UseClerk(options => {
    options.Endpointprefix = "/endpoint";
});

The endpoint prefix is the prefix that will be used for the webhook endpoint. The default is "/clerk".

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
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