Runtime SDKsNode.js SDK

Node.js SDK

Install the Node.js agent, attach lifecycle hooks, and upload external source maps for original TypeScript locations.

Install

shell
npm install @doomslayer2945/liveprobe-node@0.3.0

Start and stop

typescript
import { LiveProbe } from "@doomslayer2945/liveprobe-node";

const agent = await LiveProbe.start({
  serviceId: process.env.LIVEPROBE_SERVICE_ID!,
  brokerUrl: process.env.LIVEPROBE_BROKER_URL!,
  apiKey: process.env.LIVEPROBE_API_KEY,
  commitSha: process.env.LIVEPROBE_COMMIT_SHA ?? process.env.GIT_COMMIT,
  projectId: process.env.LIVEPROBE_PROJECT_ID,
  environment: process.env.LIVEPROBE_ENVIRONMENT,
  sourceMapDir: process.env.LIVEPROBE_SOURCE_MAP_DIR,
  distLocation: process.env.LIVEPROBE_DIST_LOCATION ?? "dist",
  appRoot: process.env.LIVEPROBE_APP_ROOT,
});

process.once("SIGTERM", () => void agent.stop());

Source map configuration

Emit external .js.map files and deploy them beside the generated JavaScript. One agent uploads maps for each service and commit; embedded sourcesContent is stripped before transport. The broker resolves original source lines to generated V8 locations.

json
{
  "compilerOptions": {
    "sourceMap": true,
    "inlineSourceMap": false
  }
}
dotenv
LIVEPROBE_SOURCE_MAP_DIR=/app/dist
LIVEPROBE_DIST_LOCATION=dist
LIVEPROBE_APP_ROOT=services/payments

LIVEPROBE_APP_ROOT is only needed when uploaded source paths must be prefixed with a monorepo subdirectory.

Safety configuration

Node enforces probe hit rate, outbound telemetry bandwidth, buffered event bytes, event-loop lag, and cooldown. See the safety reference for defaults and reason-code semantics.