Skip to content

Commit 24da7d2

Browse files
authored
Add Sentry setup to readme
1 parent 64d0656 commit 24da7d2

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,60 @@ Your `authToken` needs to have following scopes: `org:read` and `project:release
4848
#### 2. `Could not determine any commits to be associated automatically.`
4949
Your application repository needs to be connected on Sentry to your ogranization account and connected with the project.
5050

51+
## BONUS: Integrate your app with Sentry
52+
53+
1. Install Sentry:
54+
55+
`npm i @sentry/browser @sentry/integrations`
56+
57+
2. Add sentry config to `config/environment.js` file
58+
59+
```js
60+
// config/environment.js
61+
62+
// Add following config
63+
{
64+
sentry: {
65+
dsn: 'your-app-dsn'
66+
}
67+
}
68+
```
69+
70+
3. Configure Sentry instance with defaults.
71+
**Remember to define `environment` and `release`**
72+
73+
```js
74+
// app/sentry.js
75+
76+
import * as Sentry from '@sentry/browser';
77+
import { Ember } from '@sentry/integrations/esm/ember';
78+
import config from 'web-app/config/environment';
79+
80+
const sentryConfig = config.sentry || {};
81+
82+
export function startSentry() {
83+
Sentry.init({
84+
environment: config.environment,
85+
release: `${config.modulePrefix}@${config.APP.version}`,
86+
...sentryConfig,
87+
integrations: [new Ember()]
88+
});
89+
}
90+
```
91+
92+
4. Initialize Sentry at the begining of `app/index.js` file
93+
94+
```js
95+
// app/index.js
96+
97+
import { startSentry } from './sentry';
98+
99+
startSentry();
100+
101+
```
102+
103+
More info: https://simplabs.com/blog/2019/07/15/sentry-and-ember
104+
51105
## License
52106

53107
This project is licensed under the [MIT License](LICENSE.md).

0 commit comments

Comments
 (0)