{"library":"redux-mixpanel-middleware","title":"Redux Mixpanel Middleware","description":"A Redux middleware that sends Mixpanel events from dispatched actions. Version 1.0.1 integrates with mixpanel-browser client library and intercepts actions with a `meta.mixpanel` property to track events and properties. No active maintenance, few downloads, and limited flexibility compared to more modern analytics middlewares like redux-beacon.","language":"javascript","status":"maintenance","last_verified":"Sat Apr 25","install":{"commands":["npm install redux-mixpanel-middleware"],"cli":null},"imports":["import MixpanelMiddleware from 'redux-mixpanel-middleware';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import mixpanel from 'mixpanel-browser';\nimport MixpanelMiddleware from 'redux-mixpanel-middleware';\nimport { createStore, applyMiddleware } from 'redux';\n\nconst MIXPANEL_TOKEN = process.env.MIXPANEL_TOKEN ?? 'your-token';\nmixpanel.init(MIXPANEL_TOKEN);\nconst mixpanelMiddleware = new MixpanelMiddleware(mixpanel);\n\nconst reducer = (state = {}, action) => state;\nconst store = createStore(reducer, applyMiddleware(mixpanelMiddleware));\n\nstore.dispatch({\n  type: 'ADD_TO_CART',\n  payload: { id: 1, name: 'Widget' },\n  meta: {\n    mixpanel: {\n      event: 'Add to cart',\n      props: {\n        id: 1,\n        name: 'Widget',\n        price: 10\n      }\n    }\n  }\n});","lang":"javascript","description":"Initialize Mixpanel browser client, create middleware instance, apply to Redux store, and dispatch action with mixpanel meta to track event.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}