@seamapi/webhook
Advanced tools
Comparing version 1.0.0 to 1.1.0
export * from './seam-webhook.js'; | ||
export { WebhookVerificationError as SeamWebhookVerificationError } from 'svix'; |
export * from './seam-webhook.js'; | ||
export { WebhookVerificationError as SeamWebhookVerificationError } from 'svix'; | ||
//# sourceMappingURL=index.js.map |
@@ -20,3 +20,4 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { | ||
verify(payload, headers) { | ||
return __classPrivateFieldGet(this, _SeamWebhook_webhook, "f").verify(payload, headers); | ||
const normalizedHeaders = Object.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value])); | ||
return __classPrivateFieldGet(this, _SeamWebhook_webhook, "f").verify(payload, normalizedHeaders); | ||
} | ||
@@ -23,0 +24,0 @@ } |
{ | ||
"name": "@seamapi/webhook", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Webhook SDK for the Seam API written in TypeScript.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
export * from './seam-webhook.js' | ||
export { WebhookVerificationError as SeamWebhookVerificationError } from 'svix' |
@@ -12,4 +12,8 @@ import type { SeamEvent } from '@seamapi/types/connect' | ||
verify(payload: string, headers: Record<string, string>): SeamEvent { | ||
return this.#webhook.verify(payload, headers) as SeamEvent | ||
const normalizedHeaders = Object.fromEntries( | ||
Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value]), | ||
) | ||
return this.#webhook.verify(payload, normalizedHeaders) as SeamEvent | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
18425
93