Node library to upload sourcemaps files to Sentry
npm install sentry-filesZero-dependency Node library to upload source maps to Sentry
``bash`
yarn add sentry-files --dev
`js
import path from 'path';
const { upload } = require('sentry-files');
const config = {
version: '1.0.0',
organization: 'example-organization',
project: 'example-project',
token: 'YOUR_API_TOKEN_HERE',
files: [
{
name: 'http://example.com/assets/main.js.map',
path: path.resolve(__dirname, 'path/to/main.js.map'),
},
],
};
upload(config)
.then(data => console.log('----- SUCCESS ----\n', data))
.catch(error => console.log('---- ERROR ----\n', error));
`
For an example uploading source maps of a React app check this post.
Type: function\Promise
Returns:
It creates a release and uploads the files to that release.
Type: Object\
_Required_
An object specifying the options used to create the release and upload the files.
Type: String\
_Required_
Version used to create the release.
Type: String\
_Required_
Sentry organization name.
Type: String\
_Required_
Sentry project name.
Type: String\
_Required_
Authentication token required to perform actions against the Sentry API.
_Ensure you have project:write selected under scopes._
Type: Array\
_Required_
Array of objects describing the files to upload to Sentry.
`js`
[
{
name: 'Sentry file name',
path: 'Local file path'
},
{
name: '...',
path: '...'
}
…]
Type: String\
_Required_
Name of the file on Sentry.
_More about Sentry file names: Upload a New File, Uploading Source Maps to Sentry and Assets Accessible at Multiple Origins_
Type: String`\
_Required_
Path to the file locally.
#### MIT