@subtrace/cloudflare to your Worker package.json:
fetch handler to use the Subtrace middleware:
src/index.js
SUBTRACE_TOKEN environment variable in your Wrangler config file:
wrangler.jsonc
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Use Subtrace to see HTTP requests in your Cloudflare Workers
@subtrace/cloudflare to your Worker package.json:
npm install @subtrace/cloudflare
fetch handler to use the Subtrace middleware:
import { subtrace } from "@subtrace/cloudflare";
export default {
fetch: subtrace(async (request, env, ctx) => {
return new Response("Hello World!");
}),
};
SUBTRACE_TOKEN environment variable in your Wrangler config file:
{
"name": "my-worker",
"main": "src/index.js",
"compatibility_date": "2025-09-27",
"vars": {
// Go to https://subtrace.dev/dashboard to generate a token
"SUBTRACE_TOKEN": "subt_..."
}
}
name = "my-worker"
main = "src/index.js"
compatibility_date = "2025-09-27"
[vars]
# Go to https://subtrace.dev/dashboard to generate a token
SUBTRACE_TOKEN = "subt_..."
npx wrangler deploy