npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

preis-lab-logrocket-react-native

v1.12.7

Published

LogRocket SDK for react-native

Downloads

1

Readme

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

Android

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

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

Expo plugin

This package cannot be used in the "Expo Go" app because it requires custom native code.

After installing this npm package, add the config plugin to the plugins array of your app.json or app.config.js:

{
  "expo": {
    "plugins": ["@logrocket/react-native"]
  }
}

Now you can build your app with EAS Build or as described in the "Adding custom native code" guide.

Supported Features

| Feature | Android | iOS | | ---------------------------- | ------------------ | ------------------ | | Screen Capture | :heavy_check_mark: | :heavy_check_mark: | | View Redaction | :heavy_check_mark: | :heavy_check_mark: | | Touch Events | :heavy_check_mark: | :heavy_check_mark: | | Identify and User Traits | :heavy_check_mark: | :heavy_check_mark: | | Network Requests & Responses | :heavy_check_mark: | :heavy_check_mark: | | Console Logs | :heavy_check_mark: | :heavy_check_mark: | | Exceptions | :heavy_check_mark: | :heavy_check_mark: | | Custom Events | :heavy_check_mark: | :heavy_check_mark: | | getSessionURL | :heavy_check_mark: | :heavy_check_mark: | | Redux middleware | :heavy_check_mark: | :heavy_check_mark: | | Connection quality config | :heavy_check_mark: | :x: |

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.

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.

To enable only uploads when a wifi connection is active, use the connectionType configuration option with the value WIFI. Only supported on Android currently.

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;
    },
  },
  connectionType: 'WIFI',
  console: {
    isEnabled: {
      info: false,
    },
    shouldAggregateConsoleErrors: true,
  },
  redactionTags: ['RedactionString'],
});

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

LogRocket.identify('12345', {
  name: 'Rog Locket',
  email: '[email protected]',
});

LogRocket.captureException(new Error('error'));

LogRocket.captureMessage('a custom message', {
  tags: { method: 'POST' }, 
  extra: { couponApplied: false, total: 42.99 }
});

LogRocket.track('PurchaseComplete', {
  revenue: 42.99,
  productCategory: 'Clothing',
  productSku: 4887369299,
  couponApplied: true,
  customerSegments: ['aef34b', '97cb20']
});

Disabling Specific Platform SDKs

Android

To disable the Android SDK add the following to your project's react-native.config.js:

module.exports {
  dependencies: {
    '@logrocket/react-native': {
      platforms: {
        android: null,
      },
    },
  },
};

iOS

To disable the iOS SDK add the following to your project's react-native.config.js:

module.exports {
  dependencies: {
    '@logrocket/react-native': {
      platforms: {
        ios: null,
      },
    },
  },
};

Then run cd ios/ && pod update to ensure the Native SDK is removed as a dependency.