slipspace

Slipspace.co provider for JavaScript


Keywords
Slipspace
License
MIT
Install
bower install slipspace

Documentation

slipspace.js

Javascript client library for slipspace.co

##Getting started

We have a few ways you can install slipspace in your JavaScript project. The library has no dependencies so you can install it on any old website.

####Manually

You can manually download the JavaScript file for your project. We have both a minified production version and development version available.

####NuGet

You can install the library using the NuGet package manager

PM> Install-Package slipspace.js

####Bower

You can install the library using bower

bower install slipspace

##Usage instructions

You can start recording errors in as little as one line of code. In your webpage just reference the library and supply your API Key.

<script data-apikey="{YOUR API KEY}" src="/Scripts/slipspace-1.0.0.min.js"></script>

You can set any setting via data attributes on the script tag or by using the init({settings}) function. Any settings set using init will take precedence.

<script src="/Scripts/slipspace-1.0.0.min.js"></script>
<script>
    Slipspace.init({apikey: {YOUR API KEY}});
</script>

To manually submit an error just use the send(ex) function.

try{
  //some code that throws an error...
}catch(ex){
  Slipspace.send(ex);
}

You can also send custom data using the send method. The custom data will be accessible from the Slipspace web interface.

try{
  //some code that throws an error...
}catch(ex){
  Slipspace.send(ex, { custom: data });
}

By default we automatically catch all errors that hit the window.onerror handler, if you want to turn off automatic error handling just call.

Slipspace.detach();

##Documentation

###Settings

All settings can be set using either data attributes on the script tag that loads Slipspace or using the Slipspace.init function.

Here are all the available settings

apikey required

Your api key, required to send the error to Slipspace.

debug default: false

Whether to log debug information to the browser's console window.

level default: 2

The severity of the issue, we default to 2 (error).

Levels include: 1 (critical), 2 (error), 3 (warning), 4 (information), 5 (verbose).

environment default: production

The environment that this error occurred on.

correlationId default: none

The correlation Id for the error.

###Custom data

Custom data can be added with the addCustomData function.

Slipspace.addCustomData({custom: "data"});

It can also be passed during sending

Slipspace.send(ex, {custom: "data"});

###CorrelationId

A correlation Id is used to help identify an error that your user is talking about. You set it to a (usually) unique string and show that string to the user. They now have an identifier for the error which they can use if they want to contact you about it.

Slipspace.setCorrelationId("c7b86ba3-dce8-46ce-8d91-c0a2fc06ae06");

###User tracking

You can track which users are affected by the JavaScript errors, just use the setUser function

Slipspace.setUser("unique identifier", "email", "name")

Only the unique identifier is needed, it helps us calculate how many of your users have been affected by an error. If you want to know who has been affected by an error make sure to also include the name and email.

###Versioning

To track which version of your app an error is impacting use the setVersion method

Slipspace.setVersion("1.0.0")

##Release History

Release history for the JavaScript library

####1.0.1

A bunch of minor improvements including:

  • Version tracking support
  • User tracking support
  • Custom environment data support
  • Chaining support

####1.0.0 Initial release