Skip to content

Commit 3fb05f1

Browse files
committed
chore(express): break-check validation probe (do not merge)
1 parent d665daa commit 3fb05f1

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/express': patch
3+
---
4+
5+
Break-check validation probe. Do not merge.

packages/express/src/webhooks.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export * from '@clerk/backend/webhooks';
3535
*
3636
* @see {@link https://clerk.com/docs/webhooks/sync-data} to learn more about syncing Clerk data to your application using webhooks
3737
*/
38-
export async function verifyWebhook(req: ExpressRequest, options?: VerifyWebhookOptions) {
38+
export async function verifyWebhook(req: ExpressRequest, options: VerifyWebhookOptions) {
3939
const webRequest = incomingMessageToRequest(req);
4040
// Cloning instead of implementing the body inside incomingMessageToRequest
4141
// to make it more predictable
@@ -59,3 +59,10 @@ export async function verifyWebhook(req: ExpressRequest, options?: VerifyWebhook
5959
});
6060
return verifyWebhookBase(clonedRequest, options);
6161
}
62+
63+
/**
64+
* Returns whether the incoming Express request carries Svix webhook headers.
65+
*/
66+
export function isWebhookRequest(req: ExpressRequest): boolean {
67+
return Boolean(req.headers['svix-id']);
68+
}

0 commit comments

Comments
 (0)