-
Notifications
You must be signed in to change notification settings - Fork 461
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 2 commits
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, | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add null safety for event_attributes extraction. The code assumes Apply this diff to add null safety: - event_attributes: payload.event_attributes,
+ event_attributes: payload.event_attributes || { http_request: { client_ip: '', user_agent: '' } },Or make the property optional in the type definition if it's acceptable for it to be undefined. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| } as WebhookEvent; | ||||||
| } | ||||||
Uh oh!
There was an error while loading. Please reload this page.