hapi-raygun-client

1.2.1 • Public • Published

hapi-raygun-client

A Hapi.js v17+ plugin for reporting server-side errors to Raygun.

Usage

import Hapi from 'hapi';
import Raygun from 'hapi-raygun-client';
 
const server = new Hapi.Server();
 
server.register({
  plugin: Raygun,
  options: {
    apiKey: /* Your Raygun API key */
  }
}, err => {
  if (err) {
    throw err;
  }
 
  server.start(() => {
    console.log("Server running at:", server.info.uri);
  });
});

Configuration

  • options
    • apiKey - String. Your Raygun API key. If not set, no error handler will be registered and plugin will be a no-op.
    • filters - Array, default ["password"]. Array of strings to filter from payload sent to Raygun (see this for example)
    • log - Boolean, default false. If true, uses server.log() to log when plugin logs calls to Raygun. Depends on logging to be setup properly, i.e. use good and good-console configured to log server log events.
    • user - Function. Takes a callback accepting a single argument and returning the request's user context. See Raygun documentation for user callback
    • version - String. Format of "n.n.n.n" where n is a number. See raygun docs

Collaborators

Dependents (0)

Package Sidebar

Install

npm i hapi-raygun-client

Weekly Downloads

5

Version

1.2.1

License

MIT

Unpacked Size

6.05 kB

Total Files

5

Last publish

Collaborators

  • njhoran