Registry / observability / remimi

remimi

JSON →
library2.0.4jsnpmunverified

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 remimi
INSTALL
IMPORT
SIG · REMIMI
R
remimi
observabilityjavascriptv2.0.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import mixpanelMiddleware from 'remimi'
const mixpanelMiddleware = require('remimi').default
Default ESM export; CJS require needs .default
mixpanelMiddleware
import remimi from 'remimi'
const { mixpanelMiddleware } = require('remimi')
The middleware is the default export, not a named export. Named import will fail.
type
import type { MixpanelOptions } from 'remimi'
Package ships minimal TypeScript definitions (index.d.ts). Use import type for options interface.

Creates a Redux store with remimi middleware, configures profile selectors and formatters, and dispatches a tracked action.

import { createStore, applyMiddleware } from 'redux'; import mixpanelMiddleware from 'remimi'; import rootReducer from './reducers'; const token = process.env.MIXPANEL_TOKEN || ''; const store = createStore( rootReducer, applyMiddleware(mixpanelMiddleware(token, { personSelector: (state) => ({ $email: state.user.email, $first_name: state.user.firstName, }), uniqueIdSelector: (state) => state.user.id, actionTypeFormatter: (type) => type.replace(/_/g, ' '), propertyFormatter: (prop) => prop.toLowerCase(), valueFormatter: (val) => String(val), })) ); // Dispatch an action to track an event store.dispatch({ type: 'Sign up complete', meta: { mixpanel: { props: { source: 'landing-page' }, }, }, });
Debug
Known issues
gotchaThe package includes mixpanel-browser as a dependency. In v2.0.4, mixpanel-browser was bumped to patched versions to mitigate Autotrack XSS attacks. Always verify the mixpanel-browser version is >=2.22.4.
fix
Run `npm ls mixpanel-browser` and ensure >=2.22.4. If not, update remimi or pin mixpanel-browser.
affects: <=2.0.4
breakingv2.0.0 changed value behavior: values now remain unformatted by default when a propertyFormatter is given. Previously, propertyFormatter was applied to values as well.
fix
To retain old behavior, pass the same formatter as propertyFormatter to valueFormatter: `valueFormatter: propertyFormatter`.
affects: >=2.0.0 <2.0.0
gotchaThe middleware only fires after the Redux state has been updated (since v2.0.2). This means the action's state change is already applied when the Mixpanel event fires. If you need to track state before the update, you must reverse the middleware order or use a different pattern.
fix
Place remimi after other side-effect middleware (like sagas) that rely on state snapshots. Use `applyMiddleware(thunk, remimi, logger)` ordering.
affects: >=2.0.2
deprecatedThe package has not been updated since 2018. The Redux ecosystem has shifted to Redux Toolkit, which changes middleware setup. No issues or pull requests are addressed.
fix
Consider migrating to redux-mixpanel or rewriting middleware using Redux Toolkit's listenerMiddleware.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Actions must be plain objects. Use custom middleware for async actions.
The mixpanel action meta must be a plain object. Some users incorrectly pass functions or promises as the action or meta.mixpanel.
fix
Ensure dispatched actions are plain objects with meta.mixpanel as a plain object: `store.dispatch({ type: 'TEST', meta: { mixpanel: { eventName: 'Test', props: {} } } })`
Uncaught TypeError: mixpanelMiddleware is not a function
Using CJS require without .default, or importing a named export that doesn't exist.
fix
Use `const mixpanelMiddleware = require('remimi').default` or switch to ESM `import mixpanelMiddleware from 'remimi'`.
Warning: mixpanel-browser is not initialized. Please call mixpanel.init() first.
remimi does not initialize mixpanel-browser; it expects the library to be initialized elsewhere before the middleware is used.
fix
Add `import mixpanel from 'mixpanel-browser'; mixpanel.init(token);` before creating the store.
TypeError: Cannot read properties of null (reading 'id')
uniqueIdSelector returns null or undefined when the user is not logged in, but the middleware still tries to identify the user.
fix
Guard the uniqueIdSelector to return a fallback value (e.g., 'anonymous') or skip identification when user is absent: `uniqueIdSelector: (state) => state.user?.id || 'anonymous'`.
Upgrade
Version history
2.0.4latest on npm
Audit
Dependencies
mixpanel-browserrequiredRequired for Mixpanel client-side tracking. Version bumped to fix Autotrack CVEs.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
2
Resources
remimi — npm install remimi · libregistry