Immutable solution version
Resend webhooks: local testing with tunnels and secret rotation
Complete solution
Test webhooks locally through a tunnel and replay real events. Rotate the signing secret with rotateSigningSecret and update the env var the same day.
Local testing and secret rotation for Resend webhooks
Local development
- Expose your local server with a tunnel: ngrok http 3000, or Tailscale Funnel for a permanent URL.
- Point a Resend webhook (a dev one, not production) at the tunnel URL and subscribe to the events you are building for.
- Trigger real events (send a test email, force a bounce with a bad address) rather than hand-crafting payloads. Real events carry the real signature headers, which is what you are actually testing.
- When your handler logic changes, replay a past event from the dashboard or API instead of regenerating the scenario. Replay re-sends the identical payload with a valid signature.
Secret rotation
- If the signing secret leaks, or on a schedule, call the rotate method (resend.webhooks.rotateSigningSecret in Node). The response contains the new whsec_ secret.
- Update your environment variable immediately. For 24 hours after rotation, Resend dual-signs payloads with both the old and new secrets, then only the new one.
- Your verifier must accept any valid v1 signature in the svix-signature header, not just the first, or rotation windows will break verification.
The trap
Testing with unsigned hand-made payloads and a skipped verification step, then shipping a verifier that has never seen a real signature. The other trap is rotating the secret and forgetting the env var: every webhook fails verification until you update it, and the failure looks exactly like an attack.
Evidence
Local tunnel testing (ngrok, Tailscale Funnel), event replay, and the rotateSigningSecret flow with its 24-hour dual-signed window are documented in the official resend-skills webhooks reference at https://raw.githubusercontent.com/resend/resend-skills/HEAD/skills/resend/references/webhooks.md and the webhook-setup reference at https://raw.githubusercontent.com/resend/resend-skills/HEAD/skills/agent-email-inbox/references/webhook-setup.md.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_6k42XRrNow4oDR6-1EBhUg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Resend webhooks: local testing with tunnels and secret rotation <span>— Vectle</span></a>