Skip to content
CloseYourItdocsPages

Documentation / Connect / Connect your apps

JavaScript

The @bussolabs/closeyourit-js package works in the browser and on Node 20.16 or newer.

What it collects

On its own:

  • unhandled exceptions and Promise rejections;
  • structured logs;
  • the history before the error: clicks, navigation, console, HTTP requests (browser only);
  • slow methods, when you measure them with measure().

When you turn it on:

  • performance issues: slow or repeated HTTP calls, a page that freezes;
  • Web Vitals;
  • resource errors and CSP violations;
  • page views;
  • session recording, with form fields masked;
  • usage telemetry (server side only).

From 0.13.0, the optional /database entry observes slow and repeated queries on Node: pg, mysql2, Drizzle through those drivers and Prisma through its PostgreSQL driver. It is disabled by default. Prisma MySQL, cursors and streaming are not covered.

Install

pnpm add @bussolabs/closeyourit-js
npm install @bussolabs/closeyourit-js

One of the two commands is enough.

Configure

import * as CloseYourIt from "@bussolabs/closeyourit-js"

CloseYourIt.init({
  endpointUrl: "https://bugs.example.com",
  publicKey: "<public key of the token>",
  projectId: "<project id>",
  environment: "production",
  release: "web@1.4.2",
})

Which credential

  • In the browser use publicKey: it is not secret.
  • On Node use a secret token with ingest scope. Reading requires a separate read permission.

The token must never end up in browser code. If you pass only the token in the browser, the SDK stays off and says so in the console.

Vue and Nuxt

Version 0.12.0 adds optional Vue, Nuxt client and Nitro server adapters. Follow the Nuxt guide for public browser configuration, private server credentials, request isolation and removal.

For OpenTelemetry traces, use the separate OTLP path. The native SDK’s W3C headers and measure() do not create OTLP spans.

Other frameworks

React/Next, Angular, Svelte/SvelteKit and Express/Fastify/Nest have optional entries in package 0.13.0. Check coverage and limits before choosing an adapter. The Node database guide covers explicit installation, request boundaries, privacy and uninstall.