// use case

Expose your Next.js dev server to Discord for Discord interactions

Discord uses Ed25519-signed POSTs to your interactions URL for slash commands. The verification step happens up-front — Discord pings the URL with a Ping interaction, and your handler must respond with Pong (type 1) or the URL won't save. 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 Discord dashboard can hold onto — webhook URLs that survive laptop restarts mean fewer dashboard re-pastes.

    $ lrok reserve nex-discord
      Reserved https://nex-discord.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-discord.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-discord
      Forwarding https://nex-discord.lrok.io  ->  http://127.0.0.1:3000
  4. Paste the URL into Discord

    Discord application → General Information → Interactions Endpoint URL. Paste https://nex-discord.lrok.io/api/webhooks/handler as the destination.

  5. Watch deliveries land in the request inspector

    Every webhook Discord 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. Verify the X-Signature-Ed25519 + X-Signature-Timestamp headers using your application's public key. Reject any mismatch with 401, otherwise Discord disables your bot.

// why lrok for this

lrok's reserved subdomain is free and lives forever, so your Discord discord interactions 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