Skip to content

iconiclive/react-native-heap

 
 

Repository files navigation

react-native-heap

npm npm npm

React Native tracker for Heap.

Getting Started

npm install @heap/react-native-heap

For autotrack, add the following plugins to your .babelrc or babel.config.js file (not required for manual tracking):

{
  "plugins": [
    "add-react-displayname",
    "./node_modules/@heap/react-native-heap/instrumentor/src/index.js"
  ]
}

Installation & Setup

Usage

// Import Heap.
import Heap from '@heap/react-native-heap';

// Identify your user.
Heap.identify('123456');
Heap.addUserProperties({ name: 'John', age: 54 });

// Add event properties (these persist across sessions).
Heap.addEventProperties({ isLoggedIn: true });

// You can remove a specific property or clear everything.
Heap.removeEventProperty('isLoggedIn');
Heap.clearEventProperties();

// To track an event, use:
Heap.track('signed-up', { isPaid: true, amount: 20 });

Acknowledgements

Thank you to Mark Miyashita for creating negativetwelve/react-native-heap-analytics, which was the initial basis for this library!

About

A React Native integration for Heap

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 62.7%
  • TypeScript 23.2%
  • Ruby 5.5%
  • Java 5.4%
  • Objective-C 3.2%