seam 1.237.0 → 1.238.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +18 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -916,6 +916,24 @@ Use it to parse and validate [Seam webhook events](https://docs.seam.co/latest/d
916
916
  Refer to the [Svix docs on Consuming Webhooks](https://docs.svix.com/receiving/introduction)
917
917
  for an in-depth guide on best-practices for handling webhooks in your application.
918
918
 
919
+ Verification failures throw Svix's `WebhookVerificationError`, re-exported as
920
+ `SeamWebhookVerificationError`.
921
+ A payload that is correctly signed but unreadable throws a `SeamInvalidWebhookPayloadError`.
922
+
923
+ ```js
924
+ import { isSeamInvalidWebhookPayloadError, SeamWebhook } from 'seam'
925
+
926
+ try {
927
+ data = webhook.verify(req.body, req.headers)
928
+ } catch (err) {
929
+ if (isSeamInvalidWebhookPayloadError(err)) {
930
+ console.error('Unreadable Seam webhook payload', err)
931
+ return res.status(204).send()
932
+ }
933
+ return res.status(400).send()
934
+ }
935
+ ```
936
+
919
937
  > [!TIP]
920
938
  > This example is for [Express](https://expressjs.com/),
921
939
  > see the [Svix docs for more examples in specific frameworks](https://docs.svix.com/receiving/verifying-payloads/how).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seam",
3
- "version": "1.237.0",
3
+ "version": "1.238.0",
4
4
  "description": "JavaScript SDK for the Seam API written in TypeScript.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -77,7 +77,7 @@
77
77
  "dependencies": {
78
78
  "@seamapi/cli": "0.37.0",
79
79
  "@seamapi/http": "2.26.0",
80
- "@seamapi/webhook": "1.4.1"
80
+ "@seamapi/webhook": "1.5.0"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@types/node": "^24.10.9",