@tlianza/pigeon
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Sentry Client for Cloudflare Workers

This client attempts to adhere to the Sentry SDK Guidelines and works inside a Cloudflare Workers environment.

Usage

  1. Install it: npm install --save tlianza/pigeon
  2. Initialize the client in your worker
    import * as Pigeon from "pigeon";
    
    // Your cloudflare worker starts here
    addEventListener("fetch", event => {
      // Initialize the client with your DSN & current event
      Pigeon.init({
        dsn: "YOUR_DSN",
        event: event
      });
    
      // Make sure this is on.
      event.passThroughOnException();
      
      //Rest of your logic/routing/etc here.
    });
  3. Use it within your code like this:
    Pigeon.captureMessage("Test Message");
    
    Pigeon.captureException(new Error("TEST Error"));
    
    Pigeon.addBreadcrumb({
        category: 'method',
        message: 'Method "testmethod" was called',
        level: Severity.Info
    });

What do you get in Sentry?

You should see all of the expected request info. Stack traces should be present but line numbers will be a little sad if your code is webpacked/wrangled up. Still, you'll get the appropriate column numbers.

Sentry Example Screenshot

This is a real example from debugging the "not my phone" app.

Why is it called Pigeon?

It seemed like the Sentry clients were all named after birds (Raven, etc) and a Pigeon is a "worker bird".

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.0
    0
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i @tlianza/pigeon

Weekly Downloads

0

Version

1.2.0

License

ISC

Unpacked Size

232 kB

Total Files

10

Last publish

Collaborators

  • tlianza