-
Notifications
You must be signed in to change notification settings - Fork 419
feat(backend): Add event_attributes to Webhook type #6162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
cd2ea92
a8df90c
eadbcbf
8879e7b
943fb77
728110a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@clerk/backend': patch | ||
| --- | ||
|
|
||
| Add `event_attributes` to `Webhook`. | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -90,5 +90,6 @@ export async function verifyWebhook(request: Request, options: VerifyWebhookOpti | |||||
| type: payload.type, | ||||||
| object: 'event', | ||||||
| data: payload.data, | ||||||
| event_attributes: payload.event_attributes, | ||||||
|
||||||
| event_attributes: payload.event_attributes, | |
| event_attributes: payload.event_attributes || { http_request: { client_ip: '', user_agent: '' } }, |
🤖 Prompt for AI Agents
In packages/backend/src/webhooks.ts at line 93, the code accesses
payload.event_attributes without checking if it exists, which can cause errors
with older webhook payloads. To fix this, add a null check or use optional
chaining when extracting event_attributes to safely handle cases where it might
be undefined. Alternatively, update the type definition to make event_attributes
optional if that aligns with the expected data structure.
Uh oh!
There was an error while loading. Please reload this page.