Next.js Project Guide
Complete rollout pattern for Next.js apps (Node runtime + browser telemetry)
Use this guide when your product surface is Next.js and you need end-to-end visibility across server and browser paths.
Architecture Scope
- Server runtime: API routes, server actions, SSR logic.
- Browser runtime: user interactions, route transitions, frontend errors.
- Shared context: service/env/version/release IDs for correlation.
Recommended Setup
- Configure environment-scoped credentials.
- Initialize Node SDK on server startup paths.
- Initialize Browser SDK on client bootstrap.
- Capture request boundaries, external calls, and error paths.
- Attach release metadata from CI/CD.
Minimum Data Contract
Emit and standardize:
service:web-nextjsenv:dev/staging/prodversion: commit SHA or build ID- Request identifiers for server/client correlation
Validation Checklist
- Browser and server events are both visible.
- Server errors include request context.
- Frontend incidents can be mapped to backend traces.
- Deploy events are visible in incident timeline.
Production Hardening
- Keep server keys private; only use public keys in browser where required.
- Configure replay/sampling to control cost.
- Ensure graceful shutdown flush for server runtime.
- Validate instrumentation after each framework upgrade.
Troubleshooting
- Missing client data: verify client bootstrap executes once.
- Missing server data: verify SDK initialization in server runtime path.
- Broken correlation: standardize version/release fields.