I added Sentry event tracking to RollCall this morning. As part of
that I added some simple handling of login and logout events to set the current
user in the Sentry meta data.
First we simple add Raven and - if we have a DSN set - configure it:
There’s some minor sugar in there to add both the environment and current git commit.
Both of these are set during the build process.
To wire up log in/out events I added this little service
And tied it all together in a simple module:
A few things to note:
- I’m calling
ravenService.init() in a run() block because that way we know that
user should be ready and we can check it starting state.
- We already fire
auth.logout events elsewhere in our code so
I know those just work.