https://github.com/vsashyn/sentry-got
Convenience wrapper for Got to interact with the Sentry API
https://github.com/vsashyn/sentry-got
got sentry
Last synced: 3 months ago
JSON representation
Convenience wrapper for Got to interact with the Sentry API
- Host: GitHub
- URL: https://github.com/vsashyn/sentry-got
- Owner: vsashyn
- Created: 2020-03-02T17:03:34.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-12T11:26:36.000Z (almost 3 years ago)
- Last Synced: 2025-10-08T23:16:19.251Z (3 months ago)
- Topics: got, sentry
- Language: JavaScript
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sentry-got
> Convenience wrapper for [Got](https://github.com/sindresorhus/got) to interact with the [Sentry API](https://docs.sentry.io/api/)
## Install
```
npm i sentry-got
```
## Usage
Instead of:
```js
const got = require('got');
const token = 'foo';
(async () => {
const {body} = await got('https://sentry.io/api/0/projects/{organization_slug}/{project_slug}/events/', {
headers: {
'authorization': `Bearer ${token}`,
}
});
console.log(body);
//=> '[]'
})();
```
You can do:
```js
const sentryGot = require('sentry-got');
(async () => {
const {body} = await sentryGot('projects/{organization_slug}/{project_slug}/events/', {token: 'foo'});
console.log(body.events);
//=> '[]'
})();
```
or pass `SENTRY_ENDPOINT` and `SENTRY_TOKEN` as environment variables.