🚀 DAY 3 OF LAUNCH WEEK: Introducing Webhook Events for Pull Request Scans.Learn more →
Socket
Book a DemoInstallSign in
Socket

bugsnag-js-windowless

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bugsnag-js-windowless

Bugsnag client for JS contexts without the 'window' global

latest
Source
npmnpm
Version
1.0.9
Version published
Maintainers
1
Created
Source

Bugsnag JS Windowless

A Bugsnag client for all JS contexts without the window global.

This was made originally for Manifest V3 Chrome Extension background service workers, but works in all browser JS contexts.

npm i --save bugsnag-js-windowless
yarn add bugsnag-js-windowless
pnpm i bugsnag-js-windowless
import BugsnagJs from '@bugsnag/js';
import BugsnagSw from 'bugsnag-js-windowless';

const Bugsnag = typeof window === 'undefined' ? BugsnagSw : BugsnagJs;

Bugsnag.start({ apiKey: 'your-api-key' });

Features

  • Exact same API and types as @bugsnag/js (docs)
  • No dependencies

Todo

Differences

These are the differences between @bugsnag/js's and bugsnag-js-windowless's behavior that I don't care about for my use case. I will however accept PRs to add support for them!

  • Fetch/XHR request errors are not reported
  • Full session tracking (including config.autoTrackSessions) is not implemented
  • config.collectUserIp is not implemented and thus disabled by default
  • config.maxEvents is not implemented - all events are collected
  • config.trackInlineScripts is not implemented - this isn't really relevant to the JS contexts I built this for (chrome extension service workers)

Contributing

To get started contributing:

# Install PNPM
npm i -g pnpm

# Install dependencies
pnpm i

# Create a .env file (and include your api key)
cp .env.template .env
edit .env

# Start the demo application
pnpm start

# Run unit tests
pnpm test

# Type check and output to `dist/` directory
pnpm build

Keywords

bugsnag

FAQs

Package last updated on 07 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts