{% load i18n %} {% url sentry-manage-project project.pk as project_link %}

{% blocktrans with 'https://github.com/lincolnloop/raven-js' as link and 'http://jquery.com/' as jquery and 'http://zeptojs.com/' as zepto %}Start by installing raven-js and either jQuery or Zepto.{% endblocktrans %}

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/raven.min.js"></script>

{% blocktrans %}Add the any URLs which will be logging errors in your project's settings under Client Security:{% endblocktrans %}

{% trans "Configure the client:" %}

<script type="text/javascript">
Raven.config('{% if dsn_public %}{{ dsn_public }}{% else %}SENTRY_DSN{% endif %}');
</script>

{% trans "Now call out to the raven client to capture events:" %}

// {% trans "record a simple message" %}
Raven.captureMessage('hello world!')

// {% trans "capture an exception" %}
try {
    errorThrowingCode();
} catch(err) {
    Raven.captureException(err);
}

{% trans "You can also optionally install a default error handler to catch all exceptions:" %}

window.onerror = Raven.process;

{% trans "Note: This will only work on browsers that properly support window.onerror." %}

{% blocktrans with 'https://github.com/lincolnloop/raven-js' as link %}For more information on other uses of Raven with Javascript, please see the official documentation for raven-js.{% endblocktrans %}