- Self-hosted, Node.js runtime: use the ClickStack Node.js SDK.
- Vercel or the Edge runtime: use
@vercel/otel.
Self-hosted Next.js
Use Node.js 22.15 or later and install the SDK:instrumentation.ts in your project root, or in src if your application uses that directory. Initialize the SDK only in the Node.js runtime:
serverExternalPackages in your existing Next.js configuration so it is loaded outside the server bundle:
OTEL_SERVICE_NAME to identify your application. Do not also preload the SDK or initialize another OpenTelemetry SDK. For additional options, see the Node.js guide.
For termination and deployment considerations, see the SDK’s Next.js guidance.
Vercel and Edge runtime
Use@vercel/otel following the Next.js OpenTelemetry setup instructions. Use this setup instead of the ClickStack Node.js SDK initialization above.
Configure OTLP export using the connection settings below. Replace any example destinations and signal-specific endpoint overrides, and set the variables in your deployment configuration.
If your Vercel deployment already uses a tracing integration, configure a custom exporter for this destination; endpoint environment variables alone do not override that integration.
Configure your destination
Set a service name for either instrumentation option:- Fully managed
- Self-managed
Open Team Settings → Data → Managed Telemetry in your service and copy the OTLP HTTP endpoint and API key. Use the complete HTTPS endpoint, including its port: