Giter Club home page Giter Club logo

sentry-files's Introduction

sentry-files

Zero-dependency Node library to upload source maps to Sentry

Installation

yarn add sentry-files --dev

Usage

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.

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.

License

sentry-files's People

Contributors

jzabala avatar taniket15 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.