Skip to content

fix(resend): deliver webhooks with Svix signatures - #212

Closed
xirothedev wants to merge 2 commits into
vercel-labs:mainfrom
xirothedev:fix/resend-webhook-delivery
Closed

fix(resend): deliver webhooks with Svix signatures#212
xirothedev wants to merge 2 commits into
vercel-labs:mainfrom
xirothedev:fix/resend-webhook-delivery

Conversation

@xirothedev

Copy link
Copy Markdown

Summary

Stacked on #211 — this head branch sits on top of the SePay PR because of shared registry/README hunks. This PR's diff includes #211's changes until it merges, after which it shrinks to the resend commit only.

The resend plugin dispatched email.sent/email.delivered/etc. to the shared WebhookDispatcher, but nothing ever registered subscriptions owned by resend, so no webhook was ever delivered. This also meant Resend's real-world Svix signing scheme had no local counterpart.

  • New seed key resend.webhook_targets: [{ url, signing_secret? }]; targets register as owner-resend subscriptions (idempotent by URL)
  • Custom header factory emits Svix headers: svix-id, svix-timestamp, svix-signature: v1,<base64 HMAC-SHA256(secret, "{id}.{timestamp}.{body}")>
  • Omitted signing secrets auto-generate in Svix format (whsec_<base64>) and surface via generatedSecrets (resend.webhook_signing_secret) through a new prepareSeed hook

Test plan

  • 2 new tests: live node:http target receives email.sent + email.delivered with correct svix-* headers and signature verified by inline HMAC recomputation; omitted-vs-explicit secret behavior
  • resend package 25/25 green; monorepo pipeline green (--filter='./packages/*', 20/20)

- transactions list/details API with bearer auth (userapi wire format)
- POST /userapi/simulate/transaction creates a transaction and fans out
  real-shaped webhooks to seeded targets, recording delivery attempts
- zero-dep VietQR PNG generation (/img) with EMVCo TLV + CRC16-CCITT
- seed config: api_keys, webhook_targets, bank_accounts, transactions;
  omitted keys auto-generate via generatedSecrets
- registered in CLI/registry/docs; 10 tests
WebhookDispatcher events for resend were dispatched but no subscription
was ever registered, so nothing was delivered.

- seed key resend.webhook_targets: [{ url, signing_secret? }]
- targets register as owner-resend subscriptions on startup
- custom header factory emits svix-id/svix-timestamp/svix-signature
  (HMAC-SHA256 over {id}.{timestamp}.{body}, base64, v1,<sig>)
- omitted signing secrets auto-generate as whsec_<base64> via new
  prepareSeed/generatedSecrets hook in the registry entry
- tests: live http target asserts headers + signature verification
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

@xirothedev is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@xirothedev

Copy link
Copy Markdown
Author

Folded into #211 — this commit is now on feat/sepay-adapter (merge 658675a). Closing to keep one PR.

@xirothedev xirothedev closed this Aug 26, 2026
@xirothedev
xirothedev deleted the fix/resend-webhook-delivery branch August 26, 2026 17:01
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.

1 participant