zopio
has pre-built webhook handlers for several key services.
Payment Events
Payment events are handled in thePOST /webhooks/payments
route in the api
app. This route constructs the event and then switches on the event type to determine how to process the event.
To test webhooks locally, we’ve configured the Stripe CLI to forward webhooks to your local server. This will start automatically when you run
pnpm dev
.Authentication Events
Authentication events are handled in thePOST /webhooks/auth
route in the api
app.
Make sure you enable the webhook events you need in your Clerk project settings.
Local Development
Currently there’s no way to easily test Clerk webhooks locally, so you’ll have to test them in a staging environment. This means deploying your app to a “production” state Vercel project with development environment variables e.g.
staging-api.example.com
. Then you can add this URL to your Clerk project’s webhook settings.