@eliumhq/elium-mixpanel

2.8.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @eliumhq/elium-mixpanel

Weekly Downloads

0

Version

2.8.0

License

MIT

Unpacked Size

25.8 kB

Total Files

13

Last publish

Collaborators