Prerequisites
- Node.js 18 or later
- A running HyperProbe broker (URL provided by your team or HyperProbe cloud setup)
- The git commit SHA of the deployed build (required for source map resolution)
Installation
Install the SDK using your preferred package manager:Quick start
Initialize the agent at your entry point
Call
HyperProbe.start() at the very top of your application’s entry file — before any other imports or framework setup. This ensures the agent is active before any code that you may want to instrument runs.index.ts
Supply the commit SHA
HyperProbe requires a valid Option 2 — Set the The SDK reads
commitSha to resolve source maps and match probes to the exact version of code running in production. Without it, the agent refuses to start.You can supply it in one of two ways:Option 1 — Pass it directly in code:index.ts
GIT_COMMIT environment variable (recommended):Most CI/CD systems expose the commit SHA as an environment variable. Inject it at deploy time so your code stays clean:process.env.GIT_COMMIT automatically if commitSha is not passed in options.If
commitSha is missing or set to the string 'unknown', the agent logs a critical error and does not start. Check your deployment pipeline to ensure GIT_COMMIT is always set.Full initialization example
The example below shows a complete initialization with all available options. In most cases you only need the four required fields — the rest have safe defaults. See the configuration reference for a description of each option.index.ts
Singleton behavior
HyperProbe.start() creates a singleton agent. Calling it more than once in the same process is a no-op — the second and subsequent calls are silently ignored and the original agent continues running. You do not need to guard against duplicate initialization.
Source map uploads
On startup, the agent automatically detects whether it should upload source maps to the broker. Only one instance across your deployment handles the upload — others poll until the upload completes. The agent looks for source maps insourceMapDir (defaults to process.cwd()). Point it to your compiled output directory if your source maps live elsewhere.
Environment variables
All safety guardrail and data control options can be set via environment variables instead of code. Environment variables take precedence over the values passed inoptions. See the configuration reference for the full list.
.env
