The Bugsee JavaScript SDK: one SDK for every JavaScript runtime
Bugsee started on mobile: when an app crashes, you get the crash together with the video, logs and network traffic that led up to it. The Bugsee JavaScript SDK brings that idea to the rest of your stack — one SDK for browsers, Node.js, Bun, Electron, Cloudflare Workers, Vercel Edge, and Web and Service Workers.
First, what is in it.
The short version
- One SDK, every JavaScript runtime. In most projects you install
@bugsee/bugseeand calllaunch(). The package resolves to the right build for the runtime it is loaded in. - A report is a timeline, not just a stack trace. Console logs, network traffic, breadcrumbs and, in the browser, a replay of the page arrive attached to every crash, error and bug report.
- Adapters for the frameworks you use. React, Vue, Angular, Svelte, Solid; Next.js, Nuxt, Remix, SvelteKit, Astro; Express, Fastify, NestJS, Hono, Koa, hapi, Elysia.
- Recordings are not streamed. The recording lives in a rolling buffer on the device or server and leaves it only when a report is created.
- Private by default. Replay masks text and inputs, and network data is redacted before it is stored.
Getting started
Setup is deliberately small: add the package for your runtime or framework, then call launch() once, as early as you can. From that point the SDK captures console output, network traffic and breadcrumbs, reports uncaught errors and unhandled promise rejections, and, in the browser, records session replay.
You get the app token by creating a JavaScript application in Bugsee and choosing your target; Bugsee then shows the setup steps for that target with your token filled in. We keep the exact commands and code in the docs, so they stay current: start from the quick start, or pick your runtime or framework on the installation page.
How we built it
A few decisions shape everything else in the SDK.
One SDK for every runtime
JavaScript does not run in one place any more. A single product can have a browser front end, a Node.js or Bun API, an edge function, a worker and a desktop shell. We did not want a different SDK, with a different API and different defaults, for each of them. @bugsee/bugsee selects its browser, Node.js, Bun, Cloudflare, Vercel Edge or worker build through package exports conditions, so the same import works everywhere, and every package ships both ESM and CommonJS builds with TypeScript types.
A portable core with thin platform adapters
The core of the SDK — the client, the capture buffer, the report and upload pipelines — does not touch the DOM or any Node.js API. Everything that is specific to a runtime sits in a thin platform layer: fetch and IndexedDB in the browser, Node's HTTP stack and the file system on servers. That is why behavior stays the same from one runtime to the next, and why a runtime that lacks a capability simply goes without the feature that needs it instead of breaking.
A small kernel, with features as extensions
Session replay, canvas recording, performance monitoring and OpenTelemetry interop are extensions around a small kernel, not code baked into it. The practical effect: you do not pay for what you turn off. The replay recorder is loaded as a separate chunk only when replay runs, so replay: false keeps it out of your page entirely.
Report on error — recordings are not streamed
Bugsee does not send your users' sessions to us continuously. The SDK keeps what it captures in a rolling buffer — the last 60 seconds by default — and sends it only when a report is created: by a crash or an error, from the report dialog, or from your own code. If nothing goes wrong, the recording never leaves the device.
One thing to know: performance monitoring, which is on by default with @bugsee/bugsee, does upload finished transactions (timings, not recordings) in the background. It is a single option, performanceMonitoring: false, to turn off.
Privacy by default
The defaults are the conservative ones. Replay masks all text and input values and blocks media and iframes; password, phone, card and one-time-code fields stay masked even if you relax the rest. Network events pass through a built-in redaction of sensitive headers, URL parameters, body keys and secret-shaped values before they are stored. On top of that, filters let you rewrite or drop any log, network event or breadcrumb before it is recorded, and startBlackout() stops visual capture for a sensitive flow. Console logs, breadcrumbs and the attributes you set are not redacted for you — the privacy guide is explicit about what is and is not protected by default.
The same Bugsee API you know from mobile
The API follows our Android SDK: launch, logException, upload, setAttribute, addBreadcrumb, log, event, trace. If your team already ships Bugsee in a mobile app, the JavaScript SDK will read the same way, and its reports land in the same dashboard.
What you get
Errors and crashes
Uncaught errors and unhandled promise rejections are reported in every runtime. Handled errors go through logException, and a bug that did not throw anything can be reported with upload() or, in the browser, a built-in report dialog your users fill in. On Node.js and Bun the recording is kept on disk by default, so the report of a crash survives the crash: the next launch uploads what the previous run left behind. See errors and crashes.
Session replay
In the browser, replay is on by default. Bugsee records the DOM, not pixels: the page structure and each change to it, which the viewer rebuilds next to the logs and network events. That keeps the recording small and lets the SDK mask text before it leaves the page. Canvas content is an opt-in add-on (replay.canvas). See session replay.
Console logs, network and breadcrumbs
- Console logs —
console.*output is captured and still prints as before. - Network —
fetch,XMLHttpRequest, WebSocket, server-sent events and WebTransport, plusnode:httpon servers, with URLs, headers and bodies redacted by default. - Breadcrumbs — automatic UI-interaction breadcrumbs in the browser, plus your own through
addBreadcrumb.
All three sit on one timeline with the error, so you read what happened in order instead of correlating timestamps across tools. Guides: logs, network, breadcrumbs.
Readable stack traces, matched by debug ID
A production bundle is minified, and many versions of it run at once. Instead of guessing which source map belongs to a crash from a version string, Bugsee stamps each bundle and its source map with a debug ID derived from the content of the files. The SDK reads the ID at run time and attaches it to each stack frame, and Bugsee looks the map up by that ID. The Vite and webpack plugins do the stamping and the upload at build time (there are Rollup, esbuild and Rspack plugins too, less exercised so far), Next.js has withBugsee, Angular has ng add, and the bugsee-cli tool covers every other build. By default the local .map files are deleted after upload, so they are not deployed.
See symbolication.
On the server: every error tied to its request
A server handles many requests at once, and a log line without its request is noise. On Node.js and Bun the SDK instruments incoming requests by default, with no adapter needed, for any server built on node:http or Bun.serve. Each request gets its own context, and everything captured while it runs — logs, outgoing network calls, breadcrumbs — is tagged with it. An error reported inside a request carries that context, and a user set for one request never leaks into another.
A framework adapter adds what cannot be seen from outside: errors the framework catches itself, the route pattern (/users/:id) as the transaction name, and your user getter. See the backend overview.
Hangs and CPU profiles on Node.js and Bun
A blocked event loop throws nothing, so no crash handler sees it — and every request in the process waits. A watchdog on a separate worker thread detects it and reports it at three levels, by default after 3, 5 and 10 seconds. Hang detection is on by default.
Opt in to profiling and the SDK keeps a rolling CPU profile; a report then carries a profile.json you can open in Chrome DevTools, and a hang report carries the stack that was blocking the loop. See hangs and diagnostics.
Performance and Core Web Vitals
With @bugsee/bugsee in a browser, performance monitoring records page-load and navigation transactions and the Core Web Vitals — TTFB, FCP, LCP, CLS and INP, each with its rating. On a Node.js server each request becomes an http.server transaction that continues the caller's trace when the request carries a traceparent header. You can add your own transactions and spans. See performance.
OpenTelemetry, in both directions
If you already run OpenTelemetry, Bugsee works with it instead of beside it: it can export its finished transactions to your OTLP endpoint, and it can consume the spans your own OpenTelemetry SDK records. Both are launch options, not an extra install. See OpenTelemetry.
Electron: main, renderers and native crashes in one session
An Electron app is really three things: a Node.js main process, Chromium renderers and native code underneath. @bugsee/electron joins them into one Bugsee session. The main process owns the session and uploads reports; renderers stream their capture up to it; native crashes are collected through Electron's built-in crashReporter and attached to the same session. DOM replay is the default visual capture, and pixel video is available as an opt-in. See Electron.
AI Insights and the MCP server
Reports from the JavaScript SDK land in the same Bugsee dashboard as your mobile apps, so the rest of the platform is there too. AI Insights works with your exact source code: it finds the actual root cause of a crash or handled error and proposes the exact fix for it, and the Bugsee MCP server lets your coding assistant list and read the issues of your JavaScript applications without leaving the editor.
The packages
Everything is published on npm under the @bugsee scope, and all packages share one version. You only need a few of them:
| Where your code runs | Packages |
|---|---|
| Browser, Node.js | @bugsee/bugsee |
| Bun | @bugsee/bun |
| Electron | @bugsee/electron |
| Cloudflare Workers | @bugsee/cloudflare |
| Vercel Edge | @bugsee/vercel-edge |
| Web Workers, Service Workers | @bugsee/webworker |
| React, Vue, Angular, Svelte, Solid | @bugsee/react, @bugsee/vue, @bugsee/angular, @bugsee/svelte, @bugsee/solid |
| Next.js, Nuxt, Remix and React Router v7, SvelteKit, Astro | @bugsee/nextjs, @bugsee/nuxt, @bugsee/remix, @bugsee/sveltekit, @bugsee/astro |
| Express, Fastify, NestJS, Hono, Koa, hapi, Elysia | @bugsee/express, @bugsee/fastify, @bugsee/nestjs, @bugsee/hono, @bugsee/koa, @bugsee/hapi, @bugsee/elysia |
| Build: source maps | @bugsee/vite-plugin, @bugsee/webpack-plugin; @bugsee/bundler-plugin-core for Rollup, esbuild and Rspack |
A framework adapter is a single install: it depends on @bugsee/bugsee and re-exports it, so launch and the adapter's API come from one package. The meta-framework adapters wire the browser and the server together, so one session covers the request and the page that made it.
Some packages you never add yourself. Session replay (@bugsee/replay), canvas recording (@bugsee/replay-canvas), performance monitoring (@bugsee/performance) and OpenTelemetry interop (@bugsee/opentelemetry) come with @bugsee/bugsee and are switched on or off through launch options. The packages page lists every package and says which are internal.
Each target also has its own page on this site, with the setup code for it: Browser, Node.js, Bun, Electron, Cloudflare Workers, Vercel Edge, Web Workers; React, Vue, Angular, Svelte, Solid; Next.js, Nuxt, Remix, Astro; Express, Fastify, NestJS, Hono, Koa, hapi and Elysia. The overview is at JavaScript monitoring.
What this changes for your team
- One SDK instead of several. The front end, the API, the edge function and the desktop app use the same API, the same options and the same dashboard — and the same one as your mobile apps, if you have them.
- Faster root cause. "Cannot reproduce" usually means the report had a stack trace and nothing else. A Bugsee report shows what the user saw and did, what the app logged and which requests it made, in order, with a stack trace that points at your source files.
- Server errors you can act on. An error arrives with the request it belongs to, and the hang that never threw anything arrives as a report too.
- Privacy you do not have to bolt on. Recordings are not streamed, replay is masked and network data is redacted before you configure anything.
- Little setup. One install and one
launch()call; an adapter where your framework catches errors before the global handler sees them.
What to know before you start
We would rather be plain about this than surprise you later.
- The API is still settling. The SDK is on a
0.xversion; options and exports may still be renamed or reshaped before 1.0. The release notes list what changed in each one. - Keep the packages in step. All
@bugsee/*packages are released together under one version number; keep every one you use at the same version. - Not every runtime has every feature. Session replay needs a DOM. Hang detection and CPU profiling are for Node.js and Bun.
@bugsee/bundoes not include performance monitoring yet. Edge runtimes buffer in memory. Each platform page in the docs says what applies. - Some paths have seen more use than others. The Vite and webpack plugins are the well-trodden ones; the Rollup, esbuild and Rspack plugins are less exercised.
- Requirements. Supported browser, Node.js and Bun versions, and the Cloudflare Workers settings, are listed in the installation docs.
We run the SDK on this website ourselves, and we fix what we find — but an SDK this young gets better mostly through the things other people hit. That is where you come in.
Try it, and tell us what is missing
Create a JavaScript application in Bugsee, add the package for your runtime, and send a first report — it takes a few minutes. The quick start walks through it.
Then tell us how it went: what did not work, what was confusing, which framework or runtime you need that is not on the list. Write to support@bugsee.com. That feedback decides what we build next.
