ClerkWebhookExtensions 1.0.0
dotnet add package ClerkWebhookExtensions --version 1.0.0
NuGet\Install-Package ClerkWebhookExtensions -Version 1.0.0
<PackageReference Include="ClerkWebhookExtensions" Version="1.0.0" />
paket add ClerkWebhookExtensions --version 1.0.0
#r "nuget: ClerkWebhookExtensions, 1.0.0"
// 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 | Versions 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. |
-
net7.0
- Microsoft.AspNetCore.Mvc.Core (>= 2.2.5)
- Svix (>= 1.12.0)
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 |
---|