Support for Vercel is experimental. We strongly recommend testing it out in your preview
environment first.
- Add the
subtrace-next
package to your app:
- Import the package at the top-level:
- Add instrumentation to trace incoming requests. In your route.ts files, wrap your route handlers with the
trace
function:
- Add the
SUBTRACE_TOKEN
environment variable to your preview/production environments on Vercel:

Mark this as a sensitive environment variable.
- Deploy your app as you normally would (eg: with
vercel deploy
)