// use case

Expose your Next.js dev server to Slack for Slack events

Slack pings your Request URL with a challenge token to verify it before any events flow. Your handler must respond within 3 seconds or Slack disables the subscription. Localhost can't respond to a Slack ping, so a tunnel is mandatory. Next.js (React, Node.js) dev server.
  1. Reserve a stable subdomain

    On the lrok free plan you keep one reserved subdomain forever. Pick a name your Slack dashboard can hold onto — webhook URLs that survive laptop restarts mean fewer dashboard re-pastes.

    $ lrok reserve nex-slack
      Reserved https://nex-slack.lrok.io
  2. Run your Next.js app

    Start the dev server on port 3000 (the Next.js default).

    $ npm run dev
  3. Tunnel localhost to the public URL

    lrok forwards https://nex-slack.lrok.io/api/webhooks/handler → http://127.0.0.1:3000/api/webhooks/handler. The flag --hint binds your reserved subdomain to this tunnel.

    $ lrok http 3000 --hint nex-slack
      Forwarding https://nex-slack.lrok.io  ->  http://127.0.0.1:3000
  4. Paste the URL into Slack

    Slack app → Event Subscriptions → Request URL. Paste https://nex-slack.lrok.io/api/webhooks/handler as the destination.

  5. Watch deliveries land in the request inspector

    Every webhook Slack sends shows up at lrok.io/dashboard with full body, headers, status, and latency. Re-deliver any request to your Next.js handler with one click. On the first paste of your URL into Slack, the app sends a {"type":"url_verification","challenge":"..."} POST. Echo back the challenge as JSON and you're live.

// why lrok for this

lrok's reserved subdomain is free and lives forever, so your Slack slack events URL never rotates. $9/mo flat for unlimited tunnels — no SSO tax, no enterprise-only signature verification, no bandwidth metering. The request inspector is built in.

Related workflows