{"library":"rollbar-redux-middleware","title":"rollbar-redux-middleware","description":"Redux middleware that integrates with Rollbar error reporting. Version 0.2.0 is the current stable release. It assumes Flux Standard Action (FSA) actions where errors are indicated by an error: true flag and the payload contains the Error object. It automatically includes the Redux store state with reported errors and provides state sanitization via keypaths or a custom sanitizer function. Additionally, it offers an option to wrap all dispatched actions in a try/catch block. Differentiators: simplifies attaching Redux state to Rollbar errors and offers flexible state redaction compared to manual integration.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install rollbar-redux-middleware"],"cli":null},"imports":["import rollbarMiddleware from 'rollbar-redux-middleware';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { createStore, applyMiddleware } from 'redux';\nimport rollbar from 'rollbar';\nimport rollbarMiddleware from 'rollbar-redux-middleware';\n\nconst Rollbar = new rollbar({ accessToken: process.env.ROLLBAR_ACCESS_TOKEN ?? '' });\n\nconst initialState = { user: { name: 'Alice' } };\nconst rootReducer = (state = initialState, action) => state;\n\nconst rollbarRedux = rollbarMiddleware(Rollbar, ['user.name']);\n\nconst store = createStore(\n  rootReducer,\n  initialState,\n  applyMiddleware(rollbarRedux)\n);\n\nstore.dispatch({ type: 'TEST' });\nconsole.log('Middleware configured. Errors will be reported to Rollbar.');","lang":"javascript","description":"Shows basic setup: importing rollbar and middleware, creating a Rollbar instance, and applying the middleware with state sanitization keypaths.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}