npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-cli-raygun

v2.0.0

Published

A Raygun.com integration add on for Ember CLI

Downloads

169

Readme

Ember CLI Raygun

Build Status Ember Observer Score

This addon will allow you to report errors to Raygun from your Ember CLI app using raygun4js.

:heart: Please open an issue if you run into any troubles!


CLI installation

$ ember install ember-cli-raygun --api_key='paste_your_api_key_here'

Alternatively, you can set your API key manually by starting with:

$ ember install ember-cli-raygun

Next, set your API key in config/environment.js:

var ENV = {
  // ...
  raygun: {
    apiKey:  "paste_your_api_key_here",
    enableCrashReporting: (environment === "production")
  }
  // ...

The default blueprint (which runs during ember install ember-cli-raygun) will add the above config in your app's config/environment.js file.

Release

Raygun will now track errors in your deployed application. By default, Ember CLI Raygun is disabled unless your environment is set to "production". You can configure this behavior in config/environment.js.

Additional Configruation

CORS

ember-cli-raygun will automatically inject the raygun4js bootstrap script into the head of your Ember app. This is the most reliable way to catch errors (even during app initialization).

If you’re using CORS without unsafe-inline, you’ll need to add the following directives to ensure rg4js and Raygun load correctly:

  • script-src

    • 'sha256-kOJzCjwwBHVC6EAEX5M+ovfu9sE7JG0G9LcYssttn6I='
    • 'http://cdn.raygun.io'
  • connect-src

    • https://api.raygun.io

Accessing Raygun

Functions you might need on rg4js are exposed as an Ember Service, for instance tracking custom events:

import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default class IndexRoute extends Route {
  @service raygun;

  beforeModel() {
    this.raygun.trackEvent({
      type: 'customTiming',
      name: 'IndexRouteBeforeModel',
      duration: 1200
    })
  }
}

User Tracking

Check out the Customers section in the raygun4js documentation for full details.

Add the following snippet into your application route in app/routes/application.js:

// ...
  @service user;
  @service raygun;

  beforeModel: () {
    this.setRaygunUser();
  },

  setRaygunUser: () {
    this.raygun.setUser({
      identifier: this.get("user.id"),
      isAnonymous: false,
      email: this.get("user.email"),
      firstName: this.get("user.firstName"),
      fullName: this.get("user.fullName")
    });    
  },
// ...

Thanks! :heart:

Thanks to:

For your contributions on the previous version of this addon :)

Contributing

Pull requests are welcome!

  • git clone this repository
  • npm install

Running tests

  • ember test OR
  • ember test --server

There’s a detailed test harness in the dummy app so please check that your changes work end-to-end by running that.