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

9.13.0 • Public • Published

Sentry

Official Sentry SDK for Google Cloud Functions

Links

General

This package is a wrapper around @sentry/node, with added functionality related to various Serverless solutions. All methods available in @sentry/node can be imported from @sentry/google-cloud-serverless.

To use this SDK, call Sentry.init(options) at the very beginning of your JavaScript file.

const Sentry = require('@sentry/google-cloud-serverless');

Sentry.init({
  dsn: '__DSN__',
  tracesSampleRate: 1.0,
  // ...
});

// For HTTP Functions:

exports.helloHttp = Sentry.wrapHttpFunction((req, res) => {
  throw new Error('oh, hello there!');
});

// For Background Functions:

exports.helloEvents = Sentry.wrapEventFunction((data, context, callback) => {
  throw new Error('oh, hello there!');
});

// For CloudEvents:

exports.helloEvents = Sentry.wrapCloudEventFunction((context, callback) => {
  throw new Error('oh, hello there!');
});

Readme

Keywords

none

Package Sidebar

Install

npm i @sentry/google-cloud-serverless

Weekly Downloads

7,575

Version

9.13.0

License

MIT

Unpacked Size

135 kB

Total Files

72

Last publish

Collaborators

  • billyvg
  • mitsuhiko
  • haza
  • jauer
  • sentry-bot
  • evanpurkhiser
  • lynnagara
  • leedongwei
  • markstory
  • zeeg