File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,19 @@ export async function POST(request) {
210210}
211211```
212212
213+ If your environment doesn't support ` Request ` objects, you can pass the required information to ` validateWebhook ` directly:
214+
215+ ``` js
216+ const requestData = {
217+ id: " 123" , // the `Webhook-Id` header
218+ timestamp: " 0123456" , // the `Webhook-Timestamp` header
219+ signature: " xyz" , // the `Webhook-Signature` header
220+ body: " {...}" , // the request body as a string, ArrayBuffer or ReadableStream
221+ secret: " shhh" , // the webhook secret, obtained from the `replicate.webhooks.defaul.secret` endpoint
222+ };
223+ const webhookIsValid = await validateWebhook (requestData);
224+ ```
225+
213226## TypeScript
214227
215228The ` Replicate ` constructor and all ` replicate.* ` methods are fully typed.
You can’t perform that action at this time.
0 commit comments