SDKs

Node.js SDK

Package: @veriq/node

Works with Express, Fastify, Hono, and any Node.js server. Captures unhandled errors and unhandled promise rejections automatically.

Install with Claude Code

Install with Claude Code

Paste this prompt into Claude Code. It will install the SDK, configure your app, and add the DSN env var automatically.

Add the @veriq/node SDK to my Node.js project.

Steps:
1. Run: npm install @veriq/node
2. At the top of your entry file (before other imports), add:
   import veriq from '@veriq/node';
   veriq.init({ dsn: process.env.VERIQ_DSN!, environment: process.env.NODE_ENV });
3. Add VERIQ_DSN=[YOUR_DSN] to your .env file
4. Unhandled errors and rejected promises are captured automatically — no middleware needed

My DSN: [paste your DSN from Project Settings → API Keys]

Install

bash
npm install @veriq/node

Initialize

Call init() at the very top of your entry file, before any other imports:

ts
// src/index.ts
import veriq from '@veriq/node';

veriq.init({
  dsn: process.env.VERIQ_DSN!,
  release: process.env.APP_VERSION,
  environment: process.env.NODE_ENV,
});

// rest of your app
import('./server');
bash
# .env
VERIQ_DSN=pk_...
APP_VERSION=1.0.0
NODE_ENV=production

Manual capture

ts
import veriq from '@veriq/node';

try {
  await riskyOperation();
} catch (err) {
  veriq.captureException(err);
}

veriq.captureMessage('Job completed', { level: 'info' });

Express / Fastify

Unhandled exceptions are captured automatically. For Fastify, add a global error handler to also capture handled errors:

ts
fastify.setErrorHandler((error, request, reply) => {
  veriq.captureException(error);
  reply.status(500).send({ error: 'Internal Server Error' });
});

Source maps

bash
npx veriq-cli upload-sourcemaps \
  --project proj_xxx \
  --secret sk_... \
  --dir dist