attakei / bugsnag-firebase

JavaScript Bugsnag helper for Cloud Functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@attakei/bugsnag-firebase

JavaScript Bugsnag wrapper for Cloud Functions.

Description

This package provides Cloud Functions's wrapper that catch errors and notify to Bugsnag.

Wrapper is very simple because only to catch any errors and push to Bugsnag.

Installation

This is published at npmjs. Use npm or yarn

npm install --save @attakei/bugsnag-firebase
yarn add @attakei/bugsnag-firebase

Usage

When you declare endpoint to Cloud Functions, use busnagFunctions from configureBugsnag instead of firebase-functions.

import { configureBugsnag } from '@attakei/bugsnag-firebase';

const bugsnagFunctions = configureBugsnag({
    // Your bugsnag configurations
    apiKey: 'your-api-key',
});

/**
 * bugsnagFunctions has `https.onCall` that behavior same as original firebase-functions.
 */
export A_HTTPS_CALLABLE = bugsnagFunctions.https.onCall((data, ctx) => {
    return 'hello world';
}))

References

About

JavaScript Bugsnag helper for Cloud Functions

License:Apache License 2.0


Languages

Language:TypeScript 100.0%