{% load i18n %} {% url sentry-manage-project project.pk as project_link %}
{% blocktrans with 'https://github.com/getsentry/raven-js' as link %}Start by installing raven-js.{% endblocktrans %}
<script src="//d3nslu0hdya83q.cloudfront.net/dist/1.0.2/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>
Raven.config('{% if dsn_public %}{{ dsn_public }}{% else %}SENTRY_DSN{% endif %}').install();
</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);
}
{% blocktrans with 'http://raven-js.readthedocs.org/' as link %}For more information on other uses of Raven with Javascript, please see the official documentation for raven-js.{% endblocktrans %}