| 1 |
import Raven from 'raven-js'; |
| 2 |
import { |
| 3 |
hubspotBaseUrl, |
| 4 |
phpVersion, |
| 5 |
wpVersion, |
| 6 |
leadinPluginVersion, |
| 7 |
portalId, |
| 8 |
plugins, |
| 9 |
} from '../constants/leadinConfig'; |
| 10 |
|
| 11 |
export function configureRaven() { |
| 12 |
if (hubspotBaseUrl.indexOf('app.hubspot.com') === -1) { |
| 13 |
return; |
| 14 |
} |
| 15 |
|
| 16 |
Raven.config( |
| 17 |
'https://e9b8f382cdd130c0d415cd977d2be56f@exceptions.hubspot.com/1', |
| 18 |
{ |
| 19 |
instrument: { |
| 20 |
tryCatch: false, |
| 21 |
}, |
| 22 |
release: leadinPluginVersion, |
| 23 |
} |
| 24 |
).install(); |
| 25 |
|
| 26 |
Raven.setTagsContext({ |
| 27 |
v: leadinPluginVersion, |
| 28 |
php: phpVersion, |
| 29 |
wordpress: wpVersion, |
| 30 |
}); |
| 31 |
|
| 32 |
Raven.setExtraContext({ |
| 33 |
hub: portalId, |
| 34 |
plugins: Object.keys(plugins) |
| 35 |
.map(name => `${name}#${plugins[name]}`) |
| 36 |
.join(','), |
| 37 |
}); |
| 38 |
} |
| 39 |
|
| 40 |
export default Raven; |
| 41 |
|