Skip to content

Commit 36e3f45

Browse files
authored
feat: add webhook signing_secret to webhook response types (#710)
1 parent a83315e commit 36e3f45

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "resend",
3-
"version": "6.3.0-canary.2",
3+
"version": "6.3.0-canary.3",
44
"description": "Node.js library for the Resend API",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

src/webhooks/interfaces/create-webhook-options.interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface CreateWebhookRequestOptions extends PostOptions {}
1111
export interface CreateWebhookResponseSuccess {
1212
object: 'webhook';
1313
id: string;
14+
signing_secret: string;
1415
}
1516

1617
export type CreateWebhookResponse =

src/webhooks/interfaces/get-webhook.interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface GetWebhookResponseSuccess {
77
status: string;
88
endpoint: string;
99
events: string[] | null;
10+
signing_secret: string;
1011
}
1112

1213
export type GetWebhookResponse =

src/webhooks/webhooks.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ describe('Webhooks', () => {
4949
const response: CreateWebhookResponseSuccess = {
5050
object: 'webhook',
5151
id: '430eed87-632a-4ea6-90db-0aace67ec228',
52+
signing_secret: 'whsec_test_secret_key_123',
5253
};
5354

5455
fetchMock.mockOnce(JSON.stringify(response), {
@@ -68,6 +69,7 @@ describe('Webhooks', () => {
6869
"data": {
6970
"id": "430eed87-632a-4ea6-90db-0aace67ec228",
7071
"object": "webhook",
72+
"signing_secret": "whsec_test_secret_key_123",
7173
},
7274
"error": null,
7375
}
@@ -117,6 +119,7 @@ describe('Webhooks', () => {
117119
status: 'enabled',
118120
endpoint: 'https://example.com/webhook',
119121
events: ['email.sent', 'email.delivered'],
122+
signing_secret: 'whsec_test_secret_key_123',
120123
};
121124

122125
fetchMock.mockOnce(JSON.stringify(response), {
@@ -140,6 +143,7 @@ describe('Webhooks', () => {
140143
],
141144
"id": "430eed87-632a-4ea6-90db-0aace67ec228",
142145
"object": "webhook",
146+
"signing_secret": "whsec_test_secret_key_123",
143147
"status": "enabled",
144148
},
145149
"error": null,

0 commit comments

Comments
 (0)