{"_id":"@bydefault/vercel","_rev":"7-7e4b1540c8712aac11e6ef78055ef19b","name":"@bydefault/vercel","dist-tags":{"latest":"0.1.7"},"versions":{"0.1.0":{"name":"@bydefault/vercel","version":"0.1.0","keywords":["bydefault","vercel","nextjs","middleware","proxy","analytics"],"license":"MIT","_id":"@bydefault/vercel@0.1.0","maintainers":[{"name":"joshtc","email":"hello@joshtriedcoding.com"}],"dist":{"shasum":"bc445acbecaf29500fb76d22cb1a2e211917ca17","tarball":"https://registry.npmjs.org/@bydefault/vercel/-/vercel-0.1.0.tgz","fileCount":5,"integrity":"sha512-nF+/GZVC9oAI9IIIG1gEJ5u4Zw6lUGypnN4Yeo54RuZzfQdsL/O0aV+80yfjjpaO60Rd4X0wwvouvDyS78RITw==","signatures":[{"sig":"MEUCIEPm34BTRaktyqBDCl77VHMYWho4rhy3SqaJOQaPzgJ5AiEAlAdo2DUpLf1tNeP2x0iibQkdSblxaXJCDzF6IKrRrk4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5851},"type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"joshtc","email":"hello@joshtriedcoding.com"},"_npmVersion":"10.9.7","description":"Bydefault request capture SDK for Vercel and Next.js middleware/proxy.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/vercel_0.1.0_1781536166696_0.21123418584460207","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@bydefault/vercel","version":"0.1.1","keywords":["bydefault","vercel","nextjs","middleware","proxy","analytics"],"license":"MIT","_id":"@bydefault/vercel@0.1.1","maintainers":[{"name":"joshtc","email":"hello@joshtriedcoding.com"}],"dist":{"shasum":"f62b1c423ac508344cd4873e9033c19fb163356d","tarball":"https://registry.npmjs.org/@bydefault/vercel/-/vercel-0.1.1.tgz","fileCount":5,"integrity":"sha512-oZUQ2Ok3knMJoMyCmyILtDp7PTVjweG5/UEOu+8uIrn2drEJVVAzq0dFRr7bNizzTFL7YWsNd6WknXnkK1GZyQ==","signatures":[{"sig":"MEUCIQC9ZAfZ6kV4XGThwJcDQ74jRSlgRG6IXgSSuZwg98Sg5AIgP+Lg4nRoZUMZ31wQjeeLVpH6kIgkiT+pMCYeXvil0yo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5540},"type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"joshtc","email":"hello@joshtriedcoding.com"},"_npmVersion":"10.9.7","description":"Bydefault request capture SDK for Vercel and Next.js middleware/proxy.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/vercel_0.1.1_1781540072313_0.21163089905237542","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@bydefault/vercel","version":"0.1.2","keywords":["bydefault","vercel","nextjs","middleware","proxy","analytics"],"license":"MIT","_id":"@bydefault/vercel@0.1.2","maintainers":[{"name":"joshtc","email":"hello@joshtriedcoding.com"}],"dist":{"shasum":"651df7a098dd0e5e64e79580ed1ac5a91d437de5","tarball":"https://registry.npmjs.org/@bydefault/vercel/-/vercel-0.1.2.tgz","fileCount":5,"integrity":"sha512-ygRgDrIR7SuyAMjydhcF+uNSeJVoFYsJu/zSKuEFaWi6MEHyrg08dFYn43fbVBiGcVIhn5GP6smajlpSHwV0DQ==","signatures":[{"sig":"MEQCIGKRAolkbgRxbc0Ay/woxQ+6PyqEn2Olcu5BTpP7XaTVAiBQ7BKCk6haahT/rkiKo9EKEtWkFPmbqIs6gTZWfFyshA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5544},"type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"joshtc","email":"hello@joshtriedcoding.com"},"_npmVersion":"10.9.7","description":"Bydefault request capture SDK for Vercel and Next.js middleware/proxy.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/vercel_0.1.2_1781541398425_0.7772724214992852","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@bydefault/vercel","version":"0.1.3","keywords":["bydefault","vercel","nextjs","middleware","proxy","analytics"],"license":"MIT","_id":"@bydefault/vercel@0.1.3","maintainers":[{"name":"joshtc","email":"hello@joshtriedcoding.com"}],"dist":{"shasum":"78d15a262c8a8f6efe678c67155ca2ccc8211520","tarball":"https://registry.npmjs.org/@bydefault/vercel/-/vercel-0.1.3.tgz","fileCount":5,"integrity":"sha512-hY1nOn6e2TWTZB3VanCTqxHtlDOYe8YrlYcDVnYv/7FOeIfl5NuOguoPkvhSEXkfjrV6551UBuh2SACcFcXp2Q==","signatures":[{"sig":"MEUCIGeyqN5ix/QP4YRwiy3YxSQqMOm32fjFqb0mcijOFXFNAiEA0rzE2S4JpQfouacRe4Fp0q0p0+D9xRrkRAVmpZL1h2w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6043},"type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"joshtc","email":"hello@joshtriedcoding.com"},"_npmVersion":"10.9.7","description":"Bydefault request capture SDK for Vercel and Next.js middleware/proxy.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/vercel_0.1.3_1781542294936_0.42310640049369885","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@bydefault/vercel","version":"0.1.4","keywords":["bydefault","vercel","nextjs","middleware","proxy","analytics"],"license":"MIT","_id":"@bydefault/vercel@0.1.4","maintainers":[{"name":"joshtc","email":"hello@joshtriedcoding.com"}],"dist":{"shasum":"62adc6dbd94e20d3bde10b0d7bb7b1d5fb9114ec","tarball":"https://registry.npmjs.org/@bydefault/vercel/-/vercel-0.1.4.tgz","fileCount":5,"integrity":"sha512-sw5GSwCZ9JE8bpLd0tG8kTPWLt6iJStmRnomfB1wX65biAbu1W+Fz67IMPmHafaF7oBaLNw10+sSnvedQk6PYw==","signatures":[{"sig":"MEYCIQCyecUu3G+TuoR+heYj6TJJ3R55dXZ5vH6LfdArkDDv3wIhAPU5CKSilf98NciYGqwpB9UHA6w/Z8X36e4FIk23v6I7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9583},"type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"joshtc","email":"hello@joshtriedcoding.com"},"_npmVersion":"10.9.7","description":"Bydefault request capture SDK for Vercel and Next.js middleware/proxy.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/vercel_0.1.4_1781544102916_0.07496749744255604","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@bydefault/vercel","version":"0.1.6","keywords":["bydefault","vercel","nextjs","middleware","proxy","analytics"],"license":"MIT","_id":"@bydefault/vercel@0.1.6","maintainers":[{"name":"joshtc","email":"hello@joshtriedcoding.com"}],"dist":{"shasum":"1f61d7c5622165f3ad2bcd543bfd1c7279cd42c7","tarball":"https://registry.npmjs.org/@bydefault/vercel/-/vercel-0.1.6.tgz","fileCount":5,"integrity":"sha512-UfbzsnbuMesjhymAyBgl0lhjO3OsD5gHKV3ILwetJBmL5ycTg3TH4zk11iCY/gxgV6M14dQEoO+yNmaRP4A9Og==","signatures":[{"sig":"MEYCIQDxL5D8sjcSw+C8o3+4c9ZvGjRzhFm2VB9/0Zg30054ugIhAJxQPgn4lONqbcERhWsmBGe5LMCPdRLuyMjcJEAdXss9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12627},"type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"joshtc","email":"hello@joshtriedcoding.com"},"_npmVersion":"10.9.7","description":"Bydefault request capture SDK for Vercel and Next.js middleware/proxy.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/vercel_0.1.6_1786353619806_0.7296537145453432","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"_id":"@bydefault/vercel@0.1.7","dist":{"shasum":"2c4c95e8067071c48f7fda9e176ef3154b6a3431","tarball":"https://registry.npmjs.org/@bydefault/vercel/-/vercel-0.1.7.tgz","fileCount":5,"integrity":"sha512-e6cCST20pONFkXU9wZ3e5zAoi/uzS6EDT4hCeiWA8iX1esEB6glycSKO9wclx+tXZ6nzcPwG8L2gdhD9LxQobw==","signatures":[{"sig":"MEQCIACXr7vqs0M9N3/W5yXMF4sPXa8YGrv4C9TA9aGBkdNRAiBbBjGz1fRMHeq8Lw2w6Z2jp73Qv2iQt75Koh8TC/xSHw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICC6K4LLHTDCqHoqiNv7zfUuNtMqho5wrsNF4NyFbBBRAiAXok0O4t1Xrp9569Ek9xYVDmO81ERk+rQCiVf++h587w=="}],"unpackedSize":14212},"name":"@bydefault/vercel","type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"license":"MIT","scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"version":"0.1.7","_npmUser":{"name":"joshtc","email":"hello@joshtriedcoding.com"},"keywords":["bydefault","vercel","nextjs","middleware","proxy","analytics"],"_npmVersion":"10.9.7","description":"Bydefault request capture SDK for Vercel and Next.js middleware/proxy.","directories":{},"maintainers":[{"name":"joshtc","email":"hello@joshtriedcoding.com"}],"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vercel_0.1.7_1790151968466_0.44294540030851715"}}},"time":{"created":"2026-06-15T15:09:26.534Z","modified":"2026-09-23T08:26:08.732Z","0.1.0":"2026-06-15T15:09:26.832Z","0.1.1":"2026-06-15T16:14:32.443Z","0.1.2":"2026-06-15T16:36:38.599Z","0.1.3":"2026-06-15T16:51:35.081Z","0.1.4":"2026-06-15T17:21:43.060Z","0.1.6":"2026-08-10T09:20:19.977Z","0.1.7":"2026-09-23T08:26:08.552Z"},"license":"MIT","keywords":["bydefault","vercel","nextjs","middleware","proxy","analytics"],"description":"Bydefault request capture SDK for Vercel and Next.js middleware/proxy.","maintainers":[{"name":"joshtc","email":"hello@joshtriedcoding.com"}],"readme":"# @bydefault/vercel\n\nRequest capture for Vercel and Next.js `proxy.ts` / `middleware.ts`.\n\nThe SDK only tracks `GET` requests for page-like routes. Preflight-style\nrequests such as `HEAD`, `POST`, and other methods are ignored.\n\nBy default, `/api` and `/api/*` routes are excluded so citation counts reflect\ncontent reads without capturing API endpoints. You can customize this with\n`exclude`.\n\n## Install\n\n```sh\nnpm install @bydefault/vercel\n```\n\n## Vercel middleware (any framework)\n\nOn Vercel, `track` resolves the deployment's own `waitUntil` from the\nrequest context (Node.js and Edge runtimes alike), so the report rides\nafter the response with no context parameter to accept:\n\n```ts\nimport { Tracker } from '@bydefault/vercel'\n\nconst tracker = new Tracker({\n  token: process.env.BYDEFAULT_INGEST_TOKEN,\n})\n\nexport default function middleware(request: Request) {\n  tracker.track(request)\n}\n```\n\nWorks as `middleware.ts` at the project root of any framework deployed to\nVercel, and as Next.js `middleware.ts` / `proxy.ts` (name the export `proxy`\non Next.js 16+).\n\n## Next.js proxy.ts (self-hosted)\n\nOff Vercel there is no request context, so hand `track` the framework's\nevent to keep the report off the response path:\n\n```ts\nimport { Tracker } from '@bydefault/vercel'\nimport { NextResponse, type NextFetchEvent, type NextRequest } from 'next/server'\n\nconst tracker = new Tracker({\n  token: process.env.BYDEFAULT_INGEST_TOKEN,\n})\n\nexport function proxy(request: NextRequest, event: NextFetchEvent) {\n  tracker.track(request, event)\n  return NextResponse.next()\n}\n```\n\n## Excluding routes\n\n```ts\nconst tracker = new Tracker({\n  token: process.env.BYDEFAULT_INGEST_TOKEN,\n  exclude: ['/api', '/admin', /^\\/internal\\//],\n})\n```\n\nString excludes match the exact pathname and descendants, so `'/api'` excludes\nboth `/api` and `/api/ping`. Pass `exclude: []` to disable the default `/api`\nexclusion.\n\n## Timeout\n\nEach report is bounded to 5 seconds by default. The report runs after the\nresponse through `waitUntil` (or Next's `after()`), which keeps the invocation\nalive until it settles, so a bound is what keeps a stalled connection from\nholding a function open until the platform kills it. A report that misses the\nbound is dropped and surfaces through `onError`; the site is never affected.\n\n```ts\nconst tracker = new Tracker({\n  token: process.env.BYDEFAULT_INGEST_TOKEN,\n  timeoutMs: 2_000, // 0 disables the bound\n})\n```\n\n## Local development\n\nPoint `endpoint` at the Bydefault app:\n\n```ts\nconst tracker = new Tracker({\n  token: process.env.BYDEFAULT_INGEST_TOKEN,\n  endpoint: 'http://localhost:3000',\n})\n```\n\n## Payload\n\nThe SDK sends a simple request envelope:\n\n```ts\ntype RequestPayload = {\n  timestamp?: string\n  method: string\n  url: string\n  ip?: string\n  geo?: {\n    country?: string\n  }\n  referer?: string\n  userAgent?: string\n  accept?: string\n  acceptLanguage?: string\n  requestId?: string\n}\n```\n\nIt does not read the request body and does not send the full request header\nset. The SDK only sends the fields Bydefault needs for request attribution,\ncountry display, and AI-provider detection. No precise location (region,\ncity, coordinates) is transmitted; the visitor IP is used server-side to\nverify claimed crawler identities against the operator's published IP\nranges and is never stored.\n\nIf no token is configured, tracking is disabled with a single console\nwarning. The SDK never throws from the middleware path, so a missing or\nmisconfigured token can never affect your site.\n","readmeFilename":"README.md"}