Socket
Socket
Sign inDemoInstall

@logrocket/react-native

Package Overview
Dependencies
Maintainers
2
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@logrocket/react-native

LogRocket SDK for react-native


Version published
Weekly downloads
14K
decreased by-15.23%
Maintainers
2
Weekly downloads
 
Created
Source

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

Add the maven repository to the repositories block of build.gradle:

maven { url "https://storage.googleapis.com/logrocket-maven/" }

Supported Features

  • Identify and add traits for users
  • Capture network requests/responses
  • Capture messages logged to the console
  • Redact views

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

LogRocket 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.

To use the redaction feature, first set the testID prop on any element you want redacted, e.g., <Foo testID='RedactionString' /> Then, when you call init, send the testID value as part of the redactionTags configuration option.

Notes

  • We currently only support React Native on Android
  • identify() currently does not support only passing in user data and must be provided at least a uid

Usage

import LogRocket from '@logrocket/react-native';

LogRocket.init('YOUR_APP_ID', {
  network: {
    requestSanitizer: request => {
      if (request.headers['x-auth-token']) {
        request.headers['x-auth-token'] = '';
      }

      return request;
    },
  },
  console: {
    isEnabled: {
      info: false,
    },
  },
  redactionTags: ['RedactionString'],
});

LogRocket.getSessionURL((url) => {
  console.log("LogRocket session URL: " + url);
})

LogRocket.identify('12345', {
  name: 'Rog Locket',
  email: 'roglocket@logrocket.com',
});

FAQs

Package last updated on 17 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc