Skip to content

subtrace/nextjs-demo

Repository files navigation

Next.js + Subtrace

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 ./subtrace

Get 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_...xxxxx

Start the Next.js app with Subtrace.

npm install
./subtrace run -- npm run dev

That'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:

nextjs-demo.mov

Releases

No releases published

Packages

No packages published