GithubHelp home page GithubHelp logo

artem-sabitov / cf-sentry Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mhart/cf-sentry

0.0 1.0 0.0 33 KB

A template to create a Cloudflare worker that logs errors to Sentry

License: Apache License 2.0

JavaScript 100.00%

cf-sentry's Introduction

cf-sentry

A template to create a Cloudflare worker that logs errors to Sentry.

Generating

Use wrangler

wrangler generate projectname https://github.com/bustle/cf-sentry

Then edit the config variables in sentry.js to suit your environment:

// Get the key from the "DSN" at: https://sentry.io/settings/<org>/projects/<project>/keys/
// The "DSN" will be in the form: https://<SENTRY_KEY>@sentry.io/<SENTRY_PROJECT_ID>
// eg, https://[email protected]/123456
const SENTRY_PROJECT_ID = '123456'
const SENTRY_KEY = '0000aaaa1111bbbb2222cccc3333dddd'

// Useful if you have multiple apps within a project – not necessary, only used in TAGS and SERVER_NAME below
const APP = 'my-app'

// https://docs.sentry.io/error-reporting/configuration/?platform=javascript#environment
const ENV = 'development'

// https://docs.sentry.io/error-reporting/configuration/?platform=javascript#release
// A string describing the version of the release – we just use: git rev-parse --verify HEAD
// You can use this to associate files/source-maps: https://docs.sentry.io/cli/releases/#upload-files
const RELEASE = '0000aaaa1111bbbb2222cccc3333dddd'

// https://docs.sentry.io/enriching-error-data/context/?platform=javascript#tagging-events
const TAGS = { app: APP }

// https://docs.sentry.io/error-reporting/configuration/?platform=javascript#server-name
const SERVER_NAME = `${APP}-${ENV}`

Then you can build your project, publish it, etc with wrangler:

cd projectname
wrangler build

License

Licensed under either of

at your option.

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.