You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To prevent unauthorized requests, Replicate signs every webhook and its metadata with a unique key for each user or organization. You can use this signature to verify the webhook indeed comes from Replicate before you process it.
154
+
155
+
This client includes a `validateWebhook` convenience function that you can use to validate webhooks.
156
+
157
+
To validate webhooks:
158
+
159
+
1. Check out the [webhooks guide](https://replicate.com/docs/webhooks) to get started.
160
+
1.[Retrieve your webhook signing secret](https://replicate.com/docs/webhooks#retrieving-the-webhook-signing-key) and store it in your enviroment.
161
+
1. Update your webhook handler to call `validateWebhook(request, secret)`, where `request` is an instance of a [web-standard `Request` object](https://developer.mozilla.org/en-US/docs/Web/API/object, and `secret` is the signing secret for your environment.
162
+
163
+
Here's an example of how to validate webhooks using Next.js:
0 commit comments