Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including react-native-heap-analytics with all npm packages installed. Try it out:

require("react-native/package.json"); // react-native is a peer dependency. var reactNativeHeapAnalytics = require("react-native-heap-analytics")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

react-native-heap-analytics v2.4.0

React Native wrapper for Heap Analytics.


npm npm npm CircleCI branch

React Native wrapper for Heap Analytics.


# Yarn
yarn add react-native-heap-analytics

npm install --save react-native-heap-analytics

iOS with Cocoapods

Add the following to your Podfile:

pod "react-native-heap-analytics", path: "../node_modules/react-native-heap-analytics"

Then run:

pod install

You're done! :tada:


Run the following:

react-native link react-native-heap-analytics

TODO(mark): Add maven repository information.


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

// Start Heap.

// Identify your user.
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.

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

// Other methods exposed:

// Amount of second Heap waits before flushing the events.

If a method is missing from the official SDK, please send a PR!

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free