sentry-got
v1.0.0
Published
Convenience wrapper for Got to interact with the Sentry API
Downloads
4
Readme
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);
//=> '[]'
})();