FeaturesGuidesDocumentationPricingGet Started

Test Stripe Webhooks Locally

Use Stripe CLI for quick iteration or LocalToLink for full HTTPS endpoint testing with the Stripe Dashboard.

Option 1: Stripe CLI (fastest for development)

For day-to-day development, the Stripe CLI is the quickest path:

stripe listen --forward-to localhost:3000/api/webhooks/stripe

The CLI prints a webhook signing secret (whsec_...) for verifying events locally. No public URL required.

Option 2: LocalToLink (full HTTPS URL testing)

Use a tunnel when you need to test with the real Stripe Dashboard webhook endpoint — for example, verifying your production-like URL format or testing with Stripe's "Send test webhook" button.

# Terminal 1
npm run dev

# Terminal 2
npx localtolink --port 3000

Register in Stripe Dashboard → Developers → Webhooks:

https://YOUR-SUBDOMAIN.localtolink.com/api/webhooks/stripe

Replace YOUR-SUBDOMAIN with the 10-character subdomain LocalToLink assigns.

Verify webhook signatures

Your handler must verify Stripe signatures regardless of approach:

const event = stripe.webhooks.constructEvent(
  req.body,
  req.headers["stripe-signature"],
  process.env.STRIPE_WEBHOOK_SECRET
);

With Stripe CLI, use the whsec_ secret from stripe listen. With Dashboard webhooks, use the signing secret from the endpoint configuration.

Important notes

Related

Try it now

Start a tunnel from your project directory — no account required.

$ npx localtolink

See the full CLI reference for flags and exit codes.

LocalToLink CLI 1.0.1 — verified 2026-09-05