Native support for Node.js, NestJS, Express, and Fastify.
The NxtOne Node.js SDK runs inside your Node.js process and sends behavioral events straight to the NxtOne platform over HTTPS — there is no separate process, container, or daemon to run. A single package, @nxtone/agent, covers both TypeScript and JavaScript.
The SDK requires Node.js 20.6+.
NestJS apps also install the NestJS adapter:
The SDK has to load before your application code. The simplest way is Node's --import flag, which needs no code changes and loads the SDK before any of your modules:
Alternatively, initialize it in code: call nxtone.init() and wait for it before your server starts listening, then start Node normally.
Register NxtOneModule.forRoot() from @nxtone/nest in your root module:
Keep loading the SDK itself with --import. For a standard Nest project, update the production start script in package.json:
If you call nxtone.init() instead, await it at the top of bootstrap() in main.ts, before app.listen().
Configure the SDK with environment variables. Keep the API key out of your code — set it in the environment or your platform's secret store:
| Variable | Default | Description |
|---|---|---|
NXTONE_API_KEY | required | Without it the SDK does nothing (it prints a hint to stderr) and never fails your app. |
NXTONE_PROJECT_ID | unknown | Groups execution flows in the UI. Set it explicitly per service, here or with nxtone.init({ projectId }). |
NXTONE_EXCLUDE | — | Packages or paths to leave uninstrumented. |
The Node.js SDK also reads NXTONE_VALUE_ENCRYPTION and NXTONE_TELEMETRY, and a config file at ./nxtone.properties or ~/.nxtone/config.properties. It reads no other environment variables, so settings documented for the Java or Python SDKs — such as NXTONE_LOG_LEVEL or a shutdown timeout — have no effect here.
The SDK batches events in memory and flushes them when the process exits, for up to 5 seconds (not configurable). It does not spool to disk, so events still in memory when the process is killed are lost.
node, not npx nxtone run. The npx nxtone run launcher does not forward SIGTERM to your app, so in a container your app can be killed without shutting down cleanly — and lose its last events.On startup the SDK prints NXTONE_SESSION_ID=<uuid> to stderr. If you see a hint that the API key is missing instead, the SDK is running as a no-op — check the environment the process actually received. Then send a request and check that its execution flow appears in NxtOne under your project ID.
The SDK only makes outbound HTTPS (443) connections — to www.api.nxtone.ai and to Amazon S3 for large values — and opens no ports. If nothing shows up, work through Troubleshooting.