sentry-files
Zero-dependency Node library to upload source maps to Sentry
Installation
yarn add sentry-files --dev
Usage
;const upload = ; 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 ; ;
For an example uploading source maps of a React app check this post.
API
upload(options)
Type: function
Returns: Promise
It creates a release and uploads the files to that release.
options
Type: Object
Required
An object specifying the options used to create the release and upload the files.
options.version
Type: String
Required
Version used to create the release.
options.organization
Type: String
Required
Sentry organization name.
options.project
Type: String
Required
Sentry project name.
options.token
Type: String
Required
Authentication token required to perform actions against the Sentry API.
Ensure you have project:write
selected under scopes.
options.files
Type: Array
Required
Array of objects describing the files to upload to Sentry.
name: 'Sentry file name' path: 'Local file path' name: '...' path: '...' …
options.files.name
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
options.files.path
Type: String
Required
Path to the file locally.