LogRocket React Native Module
Getting started
$ npm install @logrocket/react-native --save
If you are using React Native < 0.60, link the package using react-native:
npx react-native link @logrocket/react-native
LogRocket instruments the XmlHttpRequest and fetch APIs to capture network requests and responses.
For network sanitization, visit our docs: https://docs.logrocket.com/reference#network
This also automatically captures all messages logged to the console. For configuration options see
our docs: https://docs.logrocket.com/reference#console. Note that the shouldAggregateConsoleErrors
option is not currently supported and will be forced to false
.
Usage
import LogRocket from '@logrocket/react-native';
LogRocket.init('YOUR_APP_ID', {
network: {
requestSaniziter: request => {
if (request.headers['x-auth-token']) {
request.headers['x-auth-token'] = '';
}
return request;
},
},
console: {
isEnabled: {
info: false,
},
},
});
LogRocket.getSessionURL((url) => {
console.log("LogRocket session URL: " + url);
})