Technical Prerequisites
- Runtime: Node.js 18 and later.
- Metadata: Access to the active git commit SHA (mandatory for matching local source coordinates to production builds).
- Source Maps: Mandatory for transpiled or bundled projects (TypeScript, Esbuild, Webpack).
Installation
Add the SDK as a dependency using your package manager:🗺️ Configuring Source Maps for Transpilers
If your project is transpiled or bundled, source maps are strictly mandatory for the SDK agent to translate compiled bytecode coordinates back to your local source files.- TypeScript (tsconfig.json)
- Esbuild
- Webpack
Ensure
"sourceMap": true is enabled in your compiler options:tsconfig.json
Initialization Walkthrough
Follow these steps to initialize the HyperProbe agent inside your application:1
Create your initialization file
Create a dedicated file named
hyperprobe.ts (or hyperprobe.js) inside your project source root. Select your module syntax below:- TypeScript / ES Modules (hyperprobe.ts)
- CommonJS (hyperprobe.js)
src/hyperprobe.ts
2
Import it in your entrypoint
In your main application entrypoint (e.g.,
index.ts, server.ts, or app.js), import your newly created ./hyperprobe module as early as possible before starting your web server:3
Configure your Dockerfile
To enable Docker-based deployments, define a
GIT_COMMIT build argument inside your Dockerfile with a default value of unknown.This ensures that existing local builds or developers’ environments do not fail if they do not yet pass a build argument—safely fallback-disabling the HyperProbe agent until a valid SHA is injected:Dockerfile
4
Run local Docker builds
For building and testing Docker containers locally on your laptop, inject your active git head using standard command line arguments:
5
Inject correct SHA in CI/CD (The PR Merge Trap)
To protect alignment, HyperProbe refuses to start if
commitSha resolves to "unknown". Map your CI/CD platform’s built-in commit SHA environment variable to GIT_COMMIT at deployment.Always use your CI/CD engine’s native environment variables to pass the real commit SHA:⚙️ Configuration & Environment Variables Reference
You can configure the agent by passing properties inside yourHyperProbe.start() options object, or by overriding them using environment variables.
The code block below illustrates a complete initialization containing all available options, along with their default values and corresponding HYPERPROBE_* environment variables which can override them:
src/hyperprobe.ts
