Skip to content

feat(webhooks): add verify() with svix signature check and typed deserialization#150

Merged
lucasloisp merged 6 commits intonextfrom
llois-c/webhook-verify
May 1, 2026
Merged

feat(webhooks): add verify() with svix signature check and typed deserialization#150
lucasloisp merged 6 commits intonextfrom
llois-c/webhook-verify

Conversation

@lucasloisp
Copy link
Copy Markdown
Collaborator

Summary

  • Rewrites PrivyWebhooksService.verify() to use the generated unsafeUnwrap() method for typed deserialization after svix signature verification
  • Returns WebhookPayload (the generated discriminated union) instead of a hand-maintained type
  • Accepts payload as string | object for backwards compatibility
  • Deprecates WebhookEvent type alias in favor of WebhookPayload

Test plan

  • Verify with string payload returns typed event
  • Verify with object payload (backwards compat) works
  • Client-level signing secret fallback
  • Invalid signature throws InvalidWebhookError
  • Missing signing secret throws InvalidWebhookError

@lucasloisp lucasloisp requested a review from jagtejsodhi April 30, 2026 17:19
@lucasloisp lucasloisp force-pushed the llois-c/webhook-verify branch 2 times, most recently from e503ca3 to c5d994d Compare April 30, 2026 18:11
@lucasloisp lucasloisp force-pushed the llois-c/webhook-verify branch from c5d994d to fad7e55 Compare May 1, 2026 16:08
@lucasloisp lucasloisp marked this pull request as ready for review May 1, 2026 16:09
@lucasloisp lucasloisp force-pushed the llois-c/webhook-verify branch from f92f207 to 2f48ec1 Compare May 1, 2026 16:22
@lucasloisp lucasloisp force-pushed the llois-c/webhook-verify branch from 2f48ec1 to 7de0194 Compare May 1, 2026 16:26
@lucasloisp lucasloisp merged commit baf3076 into next May 1, 2026
12 checks passed
@lucasloisp lucasloisp deleted the llois-c/webhook-verify branch May 1, 2026 16:29
@stainless-app stainless-app Bot mentioned this pull request May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants