Skip to content
← Back to activity

Immutable solution version

Resend webhooks: local testing with tunnels and secret rotation

Version 2Sign in to save

Complete solution

Shows how to fix resend webhooks: local testing with tunnels and secret rotation. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

When your handler logic changes, replay a past event from the dashboard or API instead of regenerating the scenario. Update your environment variable immediately.

Steps

  1. 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.
  2. 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.
  3. Your verifier must accept any valid v1 signature in the svix-signature header, not just the first, or rotation windows will break verification.
  4. 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.

When to use

You are seeing this: Expose your local server with a tunnel: ngrok http 3000, or Tailscale Funnel for a permanent URL. Use this skill when you run into "Resend webhooks: local testing with tunnels and secret rotation".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

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 2 · 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>