@cfworker/sentry
    TypeScript icon, indicating that this package has built-in type declarations

    1.12.1 • Public • Published

    @cfworker/sentry

    Minimalist Sentry client for Cloudflare workers and service workers.

    import { captureError } from '@cfworker/sentry';
    
    const sentryDsn = '...';
    const environment = 'production'; // development, etc.
    const release = '...';
    
    addEventListener('fetch', event => {
      try {
        // handle event.request ...
      } catch (err) {
        const { event_id, promise } = captureError(
          sentryDsn,
          environment,
          release,
          err,
          event.request,
          user // optional, eg { name: 'octocat' }
        );
        event.waitUntil(promise);
      }
    
      event.respondWith(
        new Response(`Internal server error. Event ID: ${event_id}`, {
          status: 500
        })
      );
    });

    Install

    npm i @cfworker/sentry

    DownloadsWeekly Downloads

    324

    Version

    1.12.1

    License

    MIT

    Unpacked Size

    10.2 kB

    Total Files

    12

    Last publish

    Collaborators

    • jdanyow