Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ export async function handleWebhooks(config: WebhookRegistrationConfig, req: Req
return await _handler(evt, handlerMap[evt.type] as HandlerFn<HandlerType>)
}

// If we don't have a handler for the event, return a 404
return new Response('', { status: 404 })
// If we don't have a handler for the event, still return 200 response or else
// the Clerk will keep retrying the event
return new Response('', { status: 200 })
}

async function _handler(event: WebhookEvent, callback: Function): Promise<Response> {
Expand All @@ -176,4 +177,4 @@ async function _handler(event: WebhookEvent, callback: Function): Promise<Respon
} else {
return new Response('', { status: 200 })
}
}
}