Skip to content
jmoeltjen edited this page Jul 8, 2015 · 9 revisions

Exceptionless JavaScript / Node.js Client Configuration

Index



Installation

JavaScript

Via Bower

  1. Install the package by running bower install exceptionless
  2. Add the script to your html page. We recommend placing this as the very first script.
<script src="bower_components/exceptionless/dist/exceptionless.min.js"></script>

Node.js

  1. Install the package by running npm install exceptionless --save-dev.
  2. Add the Exceptionless client to your app:
var client = require('exceptionless.node').ExceptionlessClient.default;

Configuration

NOTE: The only required setting that you need to configure is the client's apiKey.

JavaScript

  1. You can configure the apiKey as part of the script tag. This will be applied to all new instances of the ExceptionlessClient
<script src="bower_components/exceptionless/dist/exceptionless.min.js?apiKey=API_KEY_HERE"></script>
  1. You can set the apiKey on the default ExceptionlessClient instance.
exceptionless.ExceptionlessClient.default.config.apiKey = 'API_KEY_HERE';
  1. You can create a new instance of the ExceptionlessClient and specify the apiKey, serverUrl or configuration object.
var client = new exceptionless.ExceptionlessClient('API_KEY_HERE');
// or with a api key and server url.
var client = new exceptionless.ExceptionlessClient('API_KEY_HERE', 'http://localhost:50000');
// or with a configuration object
var client = new exceptionless.ExceptionlessClient({
apiKey: 'API_KEY_HERE',
serverUrl: 'http://localhost:50000',
submissionBatchSize: 100
});

Node.js

  1. You can set the apiKey on the default ExceptionlessClient instance.
var client = require('exceptionless.node').ExceptionlessClient.default;
client.config.apiKey = 'API_KEY_HERE';
  1. You can create a new instance of the ExceptionlessClient and specify the apiKey, serverUrl or configuration object.
var exceptionless = require('exceptionless.node');

var client = new exceptionless.ExceptionlessClient('API_KEY_HERE');
// or with a api key and server url.
var client = new exceptionless.ExceptionlessClient('API_KEY_HERE', 'http://localhost:50000');
// or with a configuration object
var client = new exceptionless.ExceptionlessClient({
apiKey: 'API_KEY_HERE',
serverUrl: 'http://localhost:50000',
submissionBatchSize: 100
});
Clone this wiki locally