We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 13c716e commit 433eb44Copy full SHA for 433eb44
1 file changed
src/resources/webhooks.ts
@@ -1,6 +1,7 @@
1
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3
import { APIResource } from '../core/resource';
4
+import { toBase64 } from '../internal/utils';
5
import * as FilesAPI from './files/files';
6
import { Webhook } from 'standardwebhooks';
7
@@ -16,7 +17,7 @@ export class Webhooks extends APIResource {
16
17
if (headers !== undefined) {
18
const keyStr: string | null = key === undefined ? this._client.webhookSecret : key;
19
if (keyStr === null) throw new Error('Webhook key must not be null in order to unwrap');
- const wh = new Webhook(keyStr);
20
+ const wh = new Webhook(toBase64(keyStr));
21
wh.verify(body, headers);
22
}
23
return JSON.parse(body) as UnwrapWebhookEvent;
0 commit comments