multicat-react

0.0.18 • Public • Published

Multicat React integration

npm license

React context provider for Multicat, the unified analytics API.

nodei.co

🚧 WIP 🏗 UNDER CONSTRUCTION 🚧

Providers:

  • Mixpanel
  • Google Analytics
  • Google Remarketing Tag
  • Facebook pixel
  • Reddit pixel
  • Twitter pixel
  • Hotjar

Install

npm install --save multicat-react

or

yarn add multicat-react

Usage

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 Provider from multicat, give it a configuration, and have it wrap the <App> component.
  • In App.js we obtain multicatView and multicatEvent from the provided context.
  • In Cart.js we obtain multicatEvent from props with the help of withMulticat consumer.

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

Readme

Keywords

none

Package Sidebar

Install

npm i multicat-react

Weekly Downloads

0

Version

0.0.18

License

MIT

Unpacked Size

154 kB

Total Files

27

Last publish

Collaborators

  • some1else