Hey, I want to incorporate LogRocket (logrocket.com) into my Gatsby project. The only code to get it running is:
$ npm i --save logrocket
import LogRocket from 'logrocket';
LogRocket.init('app/id');
What's the best way to inject this into Gatsby's lifecycle such that it only initialises once when a user starts a session? I've put directly into gatsby-browser.js and it seems to work fine but I'm not using any of the life cycle APIs
We encourage to use onClientEntry to handle things like analytics or one-time setups.
We're marking this issue as answered and closing it for now but please feel free to reopen this and comment if you would like to continue this discussion. We hope we managed to help and thank you for using Gatsby! 馃挏
Most helpful comment
We encourage to use onClientEntry to handle things like analytics or one-time setups.
We're marking this issue as answered and closing it for now but please feel free to reopen this and comment if you would like to continue this discussion. We hope we managed to help and thank you for using Gatsby! 馃挏