Skip to content
bliptracedocs

Install an SDK

JavaScript / TypeScript

The runtime SDK for Node 18+ and the browser. Build it from GitHub, then capture errors with one call.

On this page

@g8scope/js builds, scrubs and sends error envelopes using the global fetch, so it runs in Node 18+ and in browsers. The Express and Next.js adapters build on it.

Install from GitHub. This package is not on npm yet, and the repository does not ship a built dist/, so build and pack it once. Source: github.com/bliptrace/bliptrace-js.

Install

git clone https://github.com/bliptrace/bliptrace-js
cd bliptrace-js && npm install && npm run build && npm pack
# then, in your app:
npm install /path/to/bliptrace-js/g8scope-js-1.0.0.tgz

Use it

import { Client, Config } from '@g8scope/js';

const bliptrace = new Client(new Config({
  key: process.env.BLIPTRACE_KEY,
  endpoint: 'https://ingest.bliptrace.com',
  environment: 'production',
  release: '[email protected]',
  basePath: process.cwd(),          // in-app frame detection (Node)
  scrubKeys: ['password', 'token'],
  ignoreExceptions: ['AbortError'], // error .name values to skip
}));

try {
  // ...
} catch (e) {
  bliptrace.capture(e as Error, { user: { id: '123' } });
}
  • capture() builds, scrubs and sends, and never throws into your app.
  • buildEnvelope() / sendEnvelope() split the two steps, for example to send after a response.
  • The SDK does not read environment variables itself; pass values in as above.

In the browser the ingest key is visible to anyone who opens your bundle. Use a dedicated key for front-end errors so you can revoke it on its own.

Documentation