github clerk/javascript @clerk/backend@1.26.0

latest releases: @clerk/types@4.92.0, @clerk/clerk-js@5.99.0, @clerk/fastify@2.4.37...
7 months ago

Minor Changes

  • Expose retryAfter value on ClerkAPIResponseError for 429 responses. (#5480) by @dstaley

  • Introduce a verifyWebhook() function to verify incoming Clerk webhook requests and process the payload. This function handles webhook signature verification using Svix and is now available across all backend and fullstack SDKs. (#5468) by @wobsoriano

    To get started, install svix, which Clerk uses to verify its webhooks:

    npm install svix

    Then in your webhook route handler, import verifyWebhook() from the Backend SDK:

    // app/api/webhooks/route.ts
    import { verifyWebhook } from '@clerk/backend/webhooks';
    
    try {
      const evt = await verifyWebhook(req);
    
      // Do something with payload
      const { id } = evt.data;
      const eventType = evt.type;
      console.log(`Received webhook with ID ${id} and event type of ${eventType}`);
      console.log('Webhook payload:', body);
    } catch (err) {
      console.error('Error: Could not verify webhook:', err);
    }

    For more information on how to sync Clerk data to your app with webhooks, see our guide.

  • Redirect to tasks on auth.protect and auth.redirectToSignIn (#5440) by @LauraBeatris

Patch Changes

Don't miss a new javascript release

NewReleases is sending notifications on new releases.