Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@openreplay/tracker-mobx

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openreplay/tracker-mobx

Tracker plugin for MobX events recording

  • 4.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

OpenReplay Tracker MobX plugin

A MobX plugin for OpenReplay Tracker. This plugin allows you to see the MobX events during session replay.

Installation

npm i @openreplay/tracker-mobx

Usage

Initialize the @openreplay/tracker package as usual and load the plugin into it. Then put is as a second argument to observe function from mobx package.

import Tracker from '@openreplay/tracker';
import trackerMobX from '@openreplay/tracker-mobx';
import { observe } from 'mobx';

const tracker = new Tracker({
  projectKey: YOUR_PROJECT_KEY,
});

const mobxTrackerInstance = tracker.use(trackerMobX(options)); // look below for available options
observe(yourMobxStore, mobxTrackerInstance)

Options:

interface Options {
    predicate?: (observeEvent: { type: string; name: string; object: any; debugObjectName: string }) => boolean;
    sanitize?: (resultAction: { state: any; type: string; property: string }) => { state: any; type: string; property: string };
    update?: boolean;
    add?: boolean;
    delete?: boolean;
}

trackerMobX({
  predicate: () => true,
  sanitize: (event) => event
})

Where predicate can be used to dynamically turn off capturing and sanitize can be used to modify the payload before sending it to backend. Most of the actions fall into update type, refer to mobx documentation for more details about add and delete (mostly for Maps)

Keywords

FAQs

Package last updated on 24 May 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc