{"_id":"@atlas-parthenon/sdk-nextjs","name":"@atlas-parthenon/sdk-nextjs","dist-tags":{"alpha":"0.1.0-alpha.1","latest":"0.1.0-alpha.1"},"versions":{"0.1.0-alpha.1":{"name":"@atlas-parthenon/sdk-nextjs","version":"0.1.0-alpha.1","description":"Next.js helpers for Atlas machine-authenticated telemetry.","keywords":["atlas","nextjs","observability","react","telemetry"],"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"repository":{"type":"git","url":"git+https://github.com/atlas-parthenon/atlas.git","directory":"sdks/nextjs"},"homepage":"https://github.com/atlas-parthenon/atlas/tree/main/sdks/nextjs#readme","bugs":{"url":"https://github.com/atlas-parthenon/atlas/issues"},"publishConfig":{"access":"public"},"sideEffects":false,"engines":{"node":">=18"},"dependencies":{"@atlas-parthenon/sdk-nodejs":"0.1.0-alpha.1"},"peerDependencies":{"next":">=15","react":">=19"},"scripts":{"build":"node ../../scripts/build-sdk-package.mjs","prebuild":"pnpm --filter @atlas-parthenon/sdk-nodejs build","pretest":"pnpm --filter @atlas-parthenon/sdk-nodejs build","pretypecheck":"pnpm --filter @atlas-parthenon/sdk-nodejs build","test":"tsx --test src/browser.test.ts src/config.test.ts src/server.test.ts","typecheck":"tsc -p tsconfig.json --noEmit"},"_id":"@atlas-parthenon/sdk-nextjs@0.1.0-alpha.1","_integrity":"sha512-yMBYaBve60JKSF/YCdcBuFBgnrQCxuiawIs9tkdfy6zACy6d2hHKBgSltRWqv7/rIq6UnIVnTJtjocBQMbtgCQ==","_resolved":"/var/folders/f5/b7lb90c96512pw1fb3hbh1g00000gn/T/atlas-sdk-release-jd4DMf/atlas-parthenon-sdk-nextjs-0.1.0-alpha.1.tgz","_from":"file:/var/folders/f5/b7lb90c96512pw1fb3hbh1g00000gn/T/atlas-sdk-release-jd4DMf/atlas-parthenon-sdk-nextjs-0.1.0-alpha.1.tgz","_nodeVersion":"25.8.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-yMBYaBve60JKSF/YCdcBuFBgnrQCxuiawIs9tkdfy6zACy6d2hHKBgSltRWqv7/rIq6UnIVnTJtjocBQMbtgCQ==","shasum":"98330d574d74a76d0bc1723785b636049c8b29b2","tarball":"https://registry.npmjs.org/@atlas-parthenon/sdk-nextjs/-/sdk-nextjs-0.1.0-alpha.1.tgz","fileCount":17,"unpackedSize":38933,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDbUAmpy6QFRnmIt5481F3TXn/1Psufy53wZvfVXvr3eAIhAINK/N3p+v4pFtPZ3t2Z71tRZmi5RlKU+vU9nQkXCX0y"}]},"_npmUser":{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"},"directories":{},"maintainers":[{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk-nextjs_0.1.0-alpha.1_1776528642933_0.7759981455644152"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T16:10:42.797Z","0.1.0-alpha.1":"2026-04-18T16:10:43.070Z","modified":"2026-04-18T16:10:43.362Z"},"maintainers":[{"name":"amsheehan","email":"alex.m.sheehan@gmail.com"}],"description":"Next.js helpers for Atlas machine-authenticated telemetry.","homepage":"https://github.com/atlas-parthenon/atlas/tree/main/sdks/nextjs#readme","keywords":["atlas","nextjs","observability","react","telemetry"],"repository":{"type":"git","url":"git+https://github.com/atlas-parthenon/atlas.git","directory":"sdks/nextjs"},"bugs":{"url":"https://github.com/atlas-parthenon/atlas/issues"},"readme":"# @atlas-parthenon/sdk-nextjs\n\nNext.js helpers for Atlas machine-authenticated telemetry.\n\n## What it does\n\n- reuses the installation-authenticated Node.js transport on the server\n- exposes one small browser client that forwards events to a local Next.js route\n- starts a real browser session on first activity and closes it on page hide so Atlas can list ended sessions\n- gives Next.js apps a simple server-operation wrapper for logs, exceptions, and\n  duration metrics\n\n## Typical shape\n\n```ts\nimport {\n  AtlasNextErrorMonitor,\n  createBrowserIngestRoute,\n  createInstrumentedFetch,\n  instrumentNextServerOperation\n} from \"@atlas-parthenon/sdk-nextjs\";\n```\n\n- use `instrumentNextServerOperation()` around Server Actions or Route Handlers\n- use `createInstrumentedFetch()` when you want a wrapped server-side `fetch`\n- use `createBrowserIngestRoute()` inside an app-local API route such as\n  `/api/atlas/browser`\n- mount `AtlasNextErrorMonitor` once in your root layout if you want window\n  error, unhandled-rejection, and browser session lifecycle capture\n\n## Integration Pattern\n\nKeep the SDK generic and put app-specific naming in the app:\n\n- SDK responsibility:\n  - transport\n  - browser forwarding\n  - generic operation/fetch instrumentation\n- app responsibility:\n  - operation names\n  - attrs\n  - which routes, actions, and fetches to instrument\n\nThe older names remain exported for compatibility:\n\n- `withAtlasNextServerSpan()`\n- `createAtlasNextBrowserEndpoint()`\n- `AtlasNextClientBootstrap`\n\n## Config\n\nServer helpers read the same install credentials as `@atlas-parthenon/sdk-nodejs`:\n\n- `ATLAS_INGEST_BASE_URL`\n- `ATLAS_INSTALLATION_ID`\n- `ATLAS_INSTALLATION_SECRET`\n- `ATLAS_SERVICE_NAME` or `ATLAS_FIXTURE_SERVICE_NAME`\n\nOptional enrichment:\n\n- `ATLAS_SERVICE_NAMESPACE`\n- `ATLAS_SERVICE_VERSION`\n- `ATLAS_DEPLOYMENT_ENVIRONMENT`\n- `ATLAS_RELEASE_VERSION`\n- `ATLAS_REPO`\n- `ATLAS_COMMIT_SHA`\n\n## Minimal browser setup\n\n```ts\n// app/api/atlas/browser/route.ts\nimport { createBrowserIngestRoute } from \"@atlas-parthenon/sdk-nextjs\";\n\nexport const POST = createBrowserIngestRoute();\n```\n\n```tsx\n// app/layout.tsx\nimport { AtlasNextClientBootstrap } from \"@atlas-parthenon/sdk-nextjs\";\n\nexport default function RootLayout({\n  children\n}: Readonly<{ children: React.ReactNode }>) {\n  return (\n    <html lang=\"en\">\n      <body>\n        <AtlasNextClientBootstrap endpoint=\"/api/atlas/browser\" />\n        {children}\n      </body>\n    </html>\n  );\n}\n```\n\nOnce deployed, the browser client writes a `started` event the first time it\ncaptures activity, increments a per-session error count on exceptions, and\nwrites an `ended` event when the page is hidden or unloaded. Atlas can then\ngroup those events into ended browser sessions.\n\n## Publishing\n\nAtlas maintainers can verify and package both SDKs from the repo root with:\n\n```sh\npnpm sdk:check\n```\n\nThat script typechecks, tests, rebuilds, packs, and validates the npm tarballs\nbefore any publish step.\n","readmeFilename":"README.md","_rev":"1-a3b7b6b827395bc7d585a735512c531d"}