This repo shows how to add Subtrace to a sample Next.js app. Subtrace connects your server to Chrome DevTools so that you can inspect the status, headers, payload, and latency of each request.
With Subtrace, you can debug your production app way faster.
Clone this repo, and download Subtrace on your machine:
curl -fSLO "https://subtrace.dev/download/$(uname -s)/$(uname -m)/subtrace" && chmod +x ./subtraceGet a SUBTRACE_TOKEN from the Subtrace dashboard and set it as
an environment variable.
# get a tracer token for free at https://subtrace.dev/dashboard
export SUBTRACE_TOKEN=subt_...xxxxxStart the Next.js app with Subtrace.
npm install
./subtrace run -- npm run devThat's it! You can now visit localhost:3000 and make requests to the Next.js server that show up on the Subtrace dashboard in realtime: