// stripe integration

Test Stripe webhooks against your localhost

Stripe needs a public HTTPS URL to deliver webhook events. Your dev server runs on http://localhost:4242. You want a stable URL that survives restarts so the Stripe dashboard config doesn't drift daily.

1 · Set up the lrok tunnel

  1. 1. Reserve a stable subdomain

    $ lrok reserve stripe-dev
  2. 2. Run your webhook handler

    $ npm run dev   # whatever serves /webhook
  3. 3. Tunnel

    $ lrok http 4242 --hint stripe-dev

2 · Configure Stripe

  1. 1. Stripe → Developers → Webhooks → Add endpoint

    Endpoint URL: paste the lrok URL below + your route, e.g. https://stripe-dev.lrok.io/webhook.

  2. 2. Pick events

    For most apps: payment_intent.succeeded, payment_intent.payment_failed, customer.subscription.* events.

  3. 3. Copy the signing secret

    Stripe shows it once after creating the endpoint. Save it as STRIPE_WEBHOOK_SECRET in your local env.

// stripe-specific gotcha

Stripe computes signatures over the raw request body. If your framework parses JSON before signature verification (express.json() before the webhook route), the re-serialized body has different whitespace than what Stripe signed and verification fails. If you're also capturing Stripe billing events into PostHog, our [PostHog setup for a 2-person devtool](/blog/posthog-setup-for-tiny-devtool) covers server-side capture from webhooks end-to-end. Use express.raw() for the webhook route only — see /tools/webhook-signature-verifier for an interactive debugger.

More integrations