@tlianza/pigeon
v1.2.0
Published
Sentry Client for Cloudflare workers
Downloads
30
Maintainers
Readme
Sentry Client for Cloudflare Workers
This client attempts to adhere to the Sentry SDK Guidelines and works inside a Cloudflare Workers environment.
Usage
- Install it:
npm install --save tlianza/pigeon
- 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. });
- 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.
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".