New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

raygun-angular2

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raygun-angular2

Raygun integration for angular 2

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

Raygun for Angular 2

A pre-packaged Angular 2 addon that attempts to take the hard work out of logging errors with Raygun. Still very much in beta but logs plenty of information already.

Installation

From within an Angular2 project

  • npm install raygun-angular2 --save
  • typings install npm:raygun-angular2 --save

If you are using a similar setup to the Angular2 Quickstart (i.e., using SystemJS) add the following to your System.config:

      System.config({
        packages: {
          'raygun-angular2': {
              main: 'index.js',
              defaultExtension: 'js'
          },
          'stack-trace': {
              main: 'stack-trace.js',
              defaultExtension: 'js'
          }
        },
        paths: {
            'raygun-angular2': 'node_modules/raygun-angular2/',
            'stack-trace': 'node_modules/stack-trace/lib/'
        }
      });

Usage

raygun-angular2 has a dependency on @angular/http so ensure that the bundle is loaded and the provider is bootstrapped in to your application

import {bootstrap} from '@angular/platform-browser';
import {provide, ExceptionHandler} from '@angular/core';
import {HTTP_PROVIDERS} from '@angular/http';
import {RaygunExceptionHandler} from 'raygun-angular2';
import {AppComponent} from './appComponent';
import {ROUTER_PROVIDERS} from '@angular/router';

RaygunExceptionHandler.apiKey = 'Enter API Key here';

bootstrap(AppComponent, [
  ROUTER_PROVIDERS,
  HTTP_PROVIDERS,
  provide(ExceptionHandler, {useClass: RaygunExceptionHandler})
]);

Development Environments

To prevent errors being reported to Raygun during development use setDevelopmentHostnames to blacklist your local hostnames.

RaygunExceptionHandler.setDevelopmentHostnames(['localhost']);

Still To Do

  • Provide public method to set user
  • Fill in gaps in collected information
  • Use X-ApiKey headers rather than a query string, however Raygun currently does not correctly respond to the pre-flight request generated by Angular2.

Contributors

Pull requests are always welcome. Please make sure that your work is tested, follows the established code convention and passes the AppVeyor build.

Keywords

angular2

FAQs

Package last updated on 25 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts