1.0.0 • Published 5 years ago

sentry-got v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

sentry-got

Convenience wrapper for Got to interact with the Sentry API

Install

npm i sentry-got

Usage

Instead of:

const got = require('got');
const token = 'foo';

(async () => {
	const {body} = await got('https://sentry.io/api/0/projects/{organization_slug}/{project_slug}/events/', {
		json: true,
		headers: {
      'authorization': `Bearer ${token}`,
		}
	});

	console.log(body);
	//=> '[]'
})();

You can do:

const sentryGot = require('sentry-got');

(async () => {
	const {body} = await sentryGot('projects/{organization_slug}/{project_slug}/events/', {token: 'foo'});
	console.log(body.events);
	//=> '[]'
})();