//#region src/init.d.ts export interface InitOptions { /** * Install a `process.on("uncaughtException")` listener that captures the * error, flushes spans, and exits the process. Default `true`. Disable to * use your own handler. */ readonly captureUncaughtException?: boolean; /** * Install a `process.on("unhandledRejection")` listener that captures the * rejection and flushes spans. Default `true`. Disable to use your own * handler. Whether the process exits is governed by Node's * `--unhandled-rejections` flag, not the SDK. */ readonly captureUnhandledRejection?: boolean; /** * Log lifecycle events to `stdout` (`init`, `release.slug`, exporter * errors). Also activatable via `INTERFERE_DEBUG=1`. Default `false`. */ readonly debug?: boolean; /** * Deployment environment label (e.g. `production`, `staging`, `preview`). * Highest-precedence source; falls back to `INTERFERE_ENVIRONMENT`, then * `VERCEL_ENV`, then `NODE_ENV`, then `development`. Free-form — the * collector accepts any label and only filters known-local ones * (`development`/`local`/`test`) per surface config. */ readonly environment?: string; /** * Sets the OTel `service.name` resource attribute — the identity spans * are grouped by in the dashboard. Defaults to `OTEL_SERVICE_NAME` env * var, then OTel's `unknown_service:` fallback. * Use this to distinguish processes that share an `INTERFERE_PUBLIC_KEY`. */ readonly serviceName?: string; /** * Sets the OTel `service.namespace` resource attribute. Optional; useful * for grouping multiple services under one logical product surface * (e.g. `"checkout"` across an API and worker fleet). */ readonly serviceNamespace?: string; } /** * Bootstraps the Interfere Node SDK: wires a private `NodeTracerProvider` * whose spans export to the Interfere collector via OTLP/HTTP, registers an * `AsyncLocalStorageContextManager` so user spans propagate across async * boundaries. * * Idempotent — safe to call from multiple entry points; only the first call * wires up. * * Warns and bails when `INTERFERE_PUBLIC_KEY` is unset so dev runs without * the SDK configured don't crash. * * The `release.slug` resource attribute is derived deterministically from * the commit SHA (auto-detected from `INTERFERE_SOURCE_ID`, * `VERCEL_GIT_COMMIT_SHA`, `GITHUB_SHA`, or `git rev-parse HEAD`) plus the * public key — same algorithm used by `@interfere/next` and the browser SDKs, * so spans from cohabiting frontends agree on release identity. */ export declare function init(options?: InitOptions): void; /** * Flushes any buffered spans and shuts down the tracer provider. Call from * a server shutdown hook (`SIGTERM`, `process.on("beforeExit")`, framework * lifecycle close) so in-flight error spans aren't lost on exit. */ export declare function close(): Promise; /** * Forces buffered spans to be exported immediately. Useful in serverless * runtimes where the process is suspended between requests. */ export declare function flush(): Promise; //#endregion