jovo-community-plugin-sentry
    TypeScript icon, indicating that this package has built-in type declarations

    1.5.1 • Public • Published

    jovo-community-plugin-sentry

    NPM

    Node CI

    Overview

    This plugin for the Jovo Framework allows you to easily add error monitoring with Sentry to your voice projects.

    Platforms

    The following platforms are supported:

    • Amazon Alexa
    • Google Assistant
    • Samsung Bixby
    • Twilio Autopilot

    Install

    Install the plugin into your Jovo project:

    npm install jovo-community-plugin-sentry --save

    Use the plugin in:

    app.js:

    const { SentryPlugin } = require('jovo-community-plugin-sentry');
     
     
    app.use(
        // ... base imports
        new SentryPlugin()
    );

    app.ts:

    import { SentryPlugin } from 'jovo-community-plugin-sentry';
     
    app.use(
        // ... base imports
        new SentryPlugin()
    );

    Configuration

    Refer to the Sentry documentation on Configuration.

    Supported configuration values:

    • dsn
    • debug
    • release
    • environment
    • maxBreadcrumbs
    • sampleRate
    • attachStacktrace
    • serverName

    config.js or config.ts:

    plugin: {
        SentryPlugin: {
            dsn: 'https://sample@sentry.io/0000000', // or set SENTRY_DSN
            environment: process.env.JOVO_STAGE, //or set SENTRY_ENVIRONMENT
            debug: false,
            release: 'voice-app@1.0.0', //or set SENTRY_RELEASE
        },
    },

    Here is a typical implementation:

    1. In .env file (for local stage and Jovo Webhook) and in lambda environment variables (for all other stages including prod), set the SENTRY_DSN variable:
    SENTRY_DSN = "https://xxx@sentry.io/xxx"
    
    1. Set the environment value in config.js or config.ts:
      plugin: {
        SentryPlugin: {
          environment: process.env.JOVO_STAGE,
        }
      },

    Capture

    The plugin will automatically capture exceptions in the code, but you can also access the capture methods from any handler:

    this.$sentry.captureMessage('Hello, world!');
     
    this.$sentry.captureException(new Error('Good bye'));
     
    this.$sentry.captureEvent({
      message: 'Manual',
      stacktrace: [
        // ...
      ],
    });

    License

    MIT

    Keywords

    none

    Install

    npm i jovo-community-plugin-sentry

    DownloadsWeekly Downloads

    39

    Version

    1.5.1

    License

    MIT

    Unpacked Size

    13.9 kB

    Total Files

    12

    Last publish

    Collaborators

    • omenocal
    • rmtuckerphx