Skip to content

Commit 162f294

Browse files
committed
Document the validateWebhook interface on Node 18
1 parent f7a24a6 commit 162f294

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,13 @@ const requestData = {
264264
const webhookIsValid = await validateWebhook(requestData);
265265
```
266266

267+
> [!NOTE]
268+
> The `validateWebhook` function uses the global `crypto` API available in most JavaScript runtimes. Node <= 18 does not provide this global so in this case you need to either call node with the `--no-experimental-global-webcrypto` or provide the `webcrypto` module manually.
269+
> ```js
270+
> const crypto = require("node:crypto").webcrypto;
271+
> const webhookIsValid = await valdiateWebhook(requestData, crypto);
272+
> ```
273+
267274
## TypeScript
268275
269276
The `Replicate` constructor and all `replicate.*` methods are fully typed.

0 commit comments

Comments
 (0)