seam 1.267.0 → 1.269.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.
- package/README.md +8 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -953,6 +953,10 @@ Use it to parse and validate [Seam webhook events](https://docs.seam.co/latest/d
|
|
|
953
953
|
Refer to the [Svix docs on Consuming Webhooks](https://docs.svix.com/receiving/introduction)
|
|
954
954
|
for an in-depth guide on best-practices for handling webhooks in your application.
|
|
955
955
|
|
|
956
|
+
`new SeamWebhook()` reads `SEAM_WEBHOOK_SECRET` when set.
|
|
957
|
+
Otherwise, pass your webhook signing secret explicitly with `new SeamWebhook(secret)`.
|
|
958
|
+
An explicit secret takes precedence over the environment variable.
|
|
959
|
+
|
|
956
960
|
Verification failures throw Svix's `WebhookVerificationError`, re-exported as
|
|
957
961
|
`SeamWebhookVerificationError`.
|
|
958
962
|
A payload that is correctly signed but unreadable throws a `SeamInvalidWebhookPayloadError`.
|
|
@@ -960,6 +964,9 @@ A payload that is correctly signed but unreadable throws a `SeamInvalidWebhookPa
|
|
|
960
964
|
```js
|
|
961
965
|
import { isSeamInvalidWebhookPayloadError, SeamWebhook } from 'seam'
|
|
962
966
|
|
|
967
|
+
const webhook = new SeamWebhook(secret)
|
|
968
|
+
let data
|
|
969
|
+
|
|
963
970
|
try {
|
|
964
971
|
data = webhook.verify(req.body, req.headers)
|
|
965
972
|
} catch (err) {
|
|
@@ -976,15 +983,13 @@ try {
|
|
|
976
983
|
> see the [Svix docs for more examples in specific frameworks](https://docs.svix.com/receiving/verifying-payloads/how).
|
|
977
984
|
|
|
978
985
|
```js
|
|
979
|
-
import { env } from 'node:process'
|
|
980
|
-
|
|
981
986
|
import { SeamWebhook } from 'seam'
|
|
982
987
|
import express from 'express'
|
|
983
988
|
import bodyParser from 'body-parser'
|
|
984
989
|
|
|
985
990
|
const app = express()
|
|
986
991
|
|
|
987
|
-
const webhook = new SeamWebhook(
|
|
992
|
+
const webhook = new SeamWebhook() // Uses SEAM_WEBHOOK_SECRET.
|
|
988
993
|
|
|
989
994
|
app.post(
|
|
990
995
|
'/webhook',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "seam",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.269.0",
|
|
4
4
|
"description": "JavaScript SDK for the Seam API written in TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"packageManager": "npm@11.19.0",
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@seamapi/cli": "0.60.0",
|
|
79
|
-
"@seamapi/http": "2.
|
|
80
|
-
"@seamapi/webhook": "1.
|
|
79
|
+
"@seamapi/http": "2.55.0",
|
|
80
|
+
"@seamapi/webhook": "1.6.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@types/node": "^24.10.9",
|