@eliumhq/elium-mixpanel

Mixpanel integration for elium projects

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@eliumhq/elium-mixpanel
Minified + gzip package size for @eliumhq/elium-mixpanel in KB

Readme

elium-mixpanel

Basic React mixpanel integration using the HTTP API.

API

MixpanelProvider

MixpanelProvider will provide the mixpanelEvent and mixpanelSetOnce API methods in the context. Data passed to the globalProperties will be sent with every mixpanelEvent call.

withMixpanel

HoC to receive the API as props.

Event

The Event component will send a mixpanel event in componentDidMount. Requires the context from MixpanelProvider.

<Event name="my-event" type="view" data={{ extra: 'cool' }} />

RegisterUser

RegisterUser calls setOnce on componentDidMount to initialize the mixpanel user with the given data. Requires the context from MixpanelProvider.

<RegisterUser data={{ color: 'red', food: '🍔' }} />

Development

Run tests:

yarn test

Release:

yarn release  # Update changelog and create release commit
npm publish

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.