@biwave/browser
v0.5.2
Published
Biwave Browser SDK — unhandled exception & rejection capture, browser/page context, auto breadcrumbs, and session replay
Downloads
1,256
Maintainers
Readme
@biwave/browser
Browser integration SDK for Biwave error tracking, performance monitoring, and session replay (Biwave Stream).
Features
- Global Handlers: Automatically captures
window.onerrorexceptions andonunhandledrejectionpromise errors. - Auto Breadcrumbs: Captures DOM navigation, console logs, and
fetch/XHR network calls. - Rich Context: Enriches error events with browser, OS, device, screen resolution, viewport, and page URL details.
- Optional Session Replay (Biwave Stream): Lazy-loads
rrwebdynamically whenstream.enabled: trueto record user sessions with built-in privacy masking and gzip compression. - IIFE Build: Bundle available at
dist/index.global.js(exposing globalwindow.Biwave).
Installation
# pnpm
pnpm add @biwave/browser @biwave/core
# npm
npm install @biwave/browser @biwave/core
# yarn
yarn add @biwave/browser @biwave/coreBasic Usage
import { init } from '@biwave/browser';
const client = init({
clientId: 'your-client-id',
environment: 'production',
release: '[email protected]',
});
// Manual exception capture
try {
throw new Error('Something went wrong in browser');
} catch (err) {
client.captureException(err);
}Session Replay (Biwave Stream)
Enable session replay by passing stream: { enabled: true } in options:
import { init } from '@biwave/browser';
init({
clientId: 'your-client-id',
stream: {
enabled: true,
maskAllInputs: false,
maskInputOptions: { password: true },
},
});Note: rrweb is lazy-loaded only when stream.enabled is true, keeping initial bundle size minimal for standard error tracking.
License
MIT © Bitech.id
