Giter Site home page Giter Site logo

bugsnag-js-windowless's Introduction

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

bugsnag-js-windowless's People

Contributors

aaronklinker-st avatar aklinker1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.