description | full_title |
---|---|
A guide on how to integrate sentry.io with OS.js |
Sentry Integration Guide |
This guide shows how to set up sentry.io with OS.js.
Create an account and a project for client (web) and server (node).
First, run npm install @sentry/node
.
Then, in your src/server/index.js
file, add the following:
const Sentry = require('@sentry/node');
Sentry.init({dsn: 'https://xxxxxxxxxxxx@sentry.io/xxxxxx'});
[info] Restart your server after adding these changes
Add the sentry client script to your template in src/client/index.ejs
:
<!-- Add before the closing body tag -->
<script src="https://browser.sentry-cdn.com/4.4.1/bundle.min.js" crossorigin="anonymous"></script>
</body>
</html>
In the bottom of your src/client/index.js
file, add the following:
Sentry.init({dsn: 'https://xxxxxxxxxxxx@sentry.io/xxxxxx'});
[info] Rebuild your client with
npm run build