Redux

A Redux middleware for Asayer. This middleware allows you to see the application state during session replay.

Installation

npm i @asayerio/tracker-redux --save

Usage

Initialize the @asayerio/tracker package as usual and load the plugin into it. Then put the generated middleware into your Redux chain.

import { applyMiddleware, createStore } from 'redux';
import Tracker from '@asayerio/tracker';
import trackerRedux from '@asayerio/tracker-redux';
const tracker = new Tracker({
projectID: PROJECT_ID,
});
const store = createStore(
reducer,
applyMiddleware(tracker.use(trackerRedux())),
);

You can customize the middleware behavior with options to sanitize your data.

trackerRedux({
actionFilter: action => action.type !== 'DRAW', // only actions which pass this test will be recorded
actionTransformer: action => action.type === 'LOGIN' ? null : action,
actionType: action => action.type // action type for search, that's the default one
stateTransformer: state => {
const { jwt, ..._state } = state;
return _state;
},
})