mixpanel-provider-react
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

mixpanel-provider

Mixpanel provider for reactjs

Installation

Install the package

npm

npm install --save mixpanel-provider-react

yarn

yarn add mixpanel-provider-react

How to use

Provider

import React from 'react';
import { MixpanelProvider } from 'mixpanel-provider-react';

const App = (props) => (
  <MixpanelProvider apiKey={apiKey}>
    ...
  </MixpanelProvider>
);

Send data with hook

import { useMixpanel } from 'mixpanel-provider-react';

const component = () => {
    const mixpanel = useMixpanel('identity');

    mixpanel.track('event', {
          value         
        });
}

Running unit tests

Run yarn test mixpanel-provider to execute the unit tests via Jest.

Readme

Keywords

none

Package Sidebar

Install

npm i mixpanel-provider-react

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

38.8 kB

Total Files

8

Last publish

Collaborators

  • rbonillajr