Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (16 sloc) 0.756 kb

Simple Javascript Airbrake Notifier

Original script by protonet (https://github.com/protonet/simple-javascript-airbrake-notifier)

Modified for:

  • Sending more debugging data to Airbrake
  • Better component/action values to group similar errors

Usage

  • Put airbrake.js in the javascripts folder
  • Set AIRBRAKE_API_KEY and AIRBRAKE_ENVIRONMENT values
  • Include airbrake.js into your applications source

Rails Example

<% if Airbrake.configuration.public? %>
  <%= javascript_tag("
    var AIRBRAKE_API_KEY = '#{Airbrake.configuration.api_key}',
        AIRBRAKE_ENVIRONMENT = '#{Rails.env.to_s}';
  ") + javascript_include_tag("airbrake") %>
<% end %>
Jump to Line
Something went wrong with that request. Please try again.