Skip to content

Commit a8b68db

Browse files
committed
Add webhook verification functionality for secure payload validation
1 parent 916ecf4 commit a8b68db

File tree

4 files changed

+911
-1
lines changed

4 files changed

+911
-1
lines changed

.changeset/webhook-verification.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
"thirdweb": minor
3+
---
4+
5+
Added webhook verification functionality to securely verify incoming webhooks from thirdweb. This includes:
6+
7+
- New `Webhook.parse` function to verify webhook signatures and timestamps
8+
- Support for both `x-payload-signature` and `x-pay-signature` header formats
9+
- Timestamp verification with configurable tolerance
10+
- Version 2 webhook payload type support
11+
12+
Example usage:
13+
```typescript
14+
import { Webhook } from "thirdweb/bridge";
15+
16+
const webhook = await Webhook.parse(
17+
payload,
18+
headers,
19+
secret,
20+
300 // optional tolerance in seconds
21+
);
22+
```

0 commit comments

Comments
 (0)