🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@asayerio/tracker-redux

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asayerio/tracker-redux

Tracker plugin for Redux state recording

latest
Source
npmnpm
Version
5.7.0
Version published
Maintainers
3
Created
Source

Asayer Tracker Redux plugin

A Redux middleware for Asayer Tracker. 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 asayerMiddleware = tracker.use(trackerRedux());

const store = createStore(
  reducer,
  applyMiddleware(asayerMiddleware),
);

You can customize the middleware behaviour 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;
  },
})

Keywords

redux

FAQs

Package last updated on 15 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts