0.0.18 • Published 7 years ago
multicat-react v0.0.18
Multicat React integration
React context provider for Multicat, the unified analytics API.

🚧 WIP 🏗 UNDER CONSTRUCTION 🚧
Providers:
- Mixpanel
- Google Analytics
- Google Remarketing Tag
- Facebook pixel
- Reddit pixel
- Twitter pixel
- Hotjar
Install
npm install --save multicat-reactor
yarn add multicat-reactUsage
Wrap your App in a Provider, and receive multicatEvent or multicatView as props with the help of withMulticat wrapper, or receive them from the context through contextTypes.
Check the example project in this package.
- In multicat.config.js we read the values from the process environment. Set these at deploy time, or overwrite here.
- In index.js we import a
Providerfrommulticat, give it a configuration, and have it wrap the<App>component. - In App.js we obtain
multicatViewandmulticatEventfrom the providedcontext. - In Cart.js we obtain
multicatEventfrompropswith the help ofwithMulticatconsumer.
Upcoming API changes
❓📦🤷♀️
We're exploring how to implement the context provider with the new React Context API. Please check the draft proposal and state your preferences in the issues section. Thank you.
License & Contributors
MIT © Cofab