This package has been deprecated

Author message:

This package is no longer maintained. Please, use @openreplay/tracker and @openreplay/tracker-vuex instead

@asayerio/tracker-vuex

5.7.0 • Public • Published

Asayer Tracker Vuex plugin

A Vuex plugin for Asayer Tracker. This plugin allows you to see the application state during session replay.

Installation

npm i @asayerio/tracker-vuex --save

Usage

Initialize the @asayerio/tracker package as usual and load the plugin into it. Then put the generated plugin into your plugins field of your store.

import Vuex from 'vuex'
import Tracker from '@asayerio/tracker';
import trackerVuex from '@asayerio/tracker-vuex';

const asayer = new Tracker({
  projectID: PROJECT_ID,
});

const store = new Vuex.Store({
  // ...
  plugins: [tracker.plugin(trackerVuex())],
});

You can customize the plugin behaviour with options to sanitize your data. They are similar to the ones from the standard createLogger plugin.

trackerVuex({
  filter (mutation, state) {
    // returns `true` if a mutation should be logged
    // `mutation` is a `{ type, payload }`
    return mutation.type !== "aBlacklistedMutation";
  },
  transformer (state) {
    // transform the state before logging it.
    // for example return only a specific sub-tree
    return state.subTree;
  },
  mutationTransformer (mutation) {
    // mutations are logged in the format of `{ type, payload }`
    // we can format it any way we want.
    return mutation.type;
  },
})

Readme

Keywords

Package Sidebar

Install

npm i @asayerio/tracker-vuex

Weekly Downloads

0

Version

5.7.0

License

MIT

Unpacked Size

25.8 kB

Total Files

19

Last publish

Collaborators

  • estradino