JavaScript documentation

The JavaScript client is probably the easiest of all the possible clients to set up and we recommend trying it first. It also provides the greatest flexibility in terms of being platform agnostic.

To install simply add the following to your error page:

<script type="text/javascript" src="http://www.areciboapp.com/arecibo-media/lib/error.js">
</script>
<script type="text/javascript">
  arecibo.account = 'yourpublicaccountnumber';
  arecibo.run();
</script>

Download

If you'd like to download and run locally:

The source can be checked out of SVN at:

svn co http://arecibo.svn.beanstalkapp.com/clients/trunk/javascript/

Notes

The following variables are automatically assigned: ip, user_agent, url. However any of them may be overridden, with your own values should you want to.

To avoid conflict with other JavaScript libraries, an object is created called arecibo. Variables would be assigned in the following manner:

arecibo.variable = name

For example to set a status and priority, you would add in more values:

<script type="text/javascript" src="http://www.areciboapp.com/arecibo-media/lib/error-compress.js">
</script>
<script type="text/javascript">
  arecibo.account = 'yourpublicaccountnumber';
  arecibo.status = 500;
  arecibo.priority = 1;
  arecibo.run();
</script>

HTTPS support

You can link to the HTTPS version of the script, just change http into https, for example:

<script type="text/javascript" src="http://www.areciboapp.com/arecibo-media/lib/error-compress.js">

If the users browser is using HTTPS when the Javascript is run, the request will be sent using HTTPS. This prevent's any security warnings in the browser.

Note: Sending errors over HTTPS requires a paid account.

Advantages

  • Can be used on any website regardless of programming language or configuration.
  • Requires minimal install.

Disadvantages

  • Requires client to have JavaScript enabled. Most browsers will have this enabled; however, robots and other programs will not. On the other hand, do you really want to get all 404's from robots?
  • Exposes your public key to others who may also use this key.
  • Exposes variables and data in the source. You may not want this information to be known for security purposes.
  • Requires Arecibo to be up and responsive.

Documentation

Client examples

Application examples

All the sample clients are in SVN, if you create your own client, please let us know.