Redux middleware for tracking actions through Mixpanel analytics. v2.0.4 is the latest release (Feb 2018), in maintenance mode with no updates since. Integrates Mixpanel events, profile updates, and action-type-to-event mapping directly into Redux dispatch flow. Differentiates from generic analytics middleware by providing profile selectors, human-friendly formatters, and automatic action type tracking. Supports person profiles, custom properties, increment, and value formatting. Only 500+ weekly downloads on npm as of 2025; alternatives include redux-mixpanel or direct mixpanel-browser integration.
npm install remimiVerified import paths — ran on the pinned version, not inferred.
Creates a Redux store with remimi middleware, configures profile selectors and formatters, and dispatches a tracked action.
Run `npm ls mixpanel-browser` and ensure >=2.22.4. If not, update remimi or pin mixpanel-browser.
To retain old behavior, pass the same formatter as propertyFormatter to valueFormatter: `valueFormatter: propertyFormatter`.
Place remimi after other side-effect middleware (like sagas) that rely on state snapshots. Use `applyMiddleware(thunk, remimi, logger)` ordering.
Consider migrating to redux-mixpanel or rewriting middleware using Redux Toolkit's listenerMiddleware.
Ensure dispatched actions are plain objects with meta.mixpanel as a plain object: `store.dispatch({ type: 'TEST', meta: { mixpanel: { eventName: 'Test', props: {} } } })`Use `const mixpanelMiddleware = require('remimi').default` or switch to ESM `import mixpanelMiddleware from 'remimi'`.Add `import mixpanel from 'mixpanel-browser'; mixpanel.init(token);` before creating the store.
Guard the uniqueIdSelector to return a fallback value (e.g., 'anonymous') or skip identification when user is absent: `uniqueIdSelector: (state) => state.user?.id || 'anonymous'`.