openreplay/tracker/tracker
Shekar Siri cc78b5087b
dev - fixes and tracker version updates (#1351)
* fix(ui): fix for messages type from ws

* fix(ui): fixes for tab typings, use State instead of array to keep tabs

* fix(assist): fixed issue with sessionUpdate event

* fix(ui): fix support for old version of assist proto

* fix(assist): fixed issue with agent back compatibility

* fix(ui): fix assist backwards compat for messages

* change(ui): offline-playback text change to recordings

* change(ui): offline-playback text change to recordings

* fix(assist): added meta header only for sessions from old tracker

* fix(ui): fix assist backwards compat for messages

* tracker version

---------

Co-authored-by: nick-delirium <nikita@openreplay.com>
Co-authored-by: Alexander Zavorotynskiy <zavorotynskiy@pm.me>
2023-06-19 19:32:00 +02:00
..
scripts feat(tracker): linting hook for tracker 2022-07-25 12:21:06 +02:00
src fix(tracker/ui): fix string dictionary handling, reset tab state on tab change (#1334) 2023-06-12 13:31:40 +02:00
.eslintignore change(tracker): unit tests for tracker 2023-02-06 12:42:18 +01:00
.eslintrc.cjs change(tracker): unit tests for tracker 2023-02-06 12:42:18 +01:00
.gitignore feat(tracker): export test coverage for tracker 2023-05-31 11:41:40 +02:00
.npmignore Chore(release): v1.7.0 (#578) 2022-07-07 18:44:43 +02:00
.prettierignore Message protocol update (message size) (#663) 2022-08-22 12:32:48 +02:00
.prettierrc.json Message protocol update (message size) (#663) 2022-08-22 12:32:48 +02:00
CHANGELOG.md feat(tracker/ui): support for multi tab sessions (#1236) 2023-06-07 10:40:32 +02:00
jest.config.js fix(tracker): fix test conf 2023-05-31 12:04:11 +02:00
js_errors.txt feat: tracker init 2021-05-03 13:31:55 +02:00
LICENSE MIT license for OpenReplay protocol 2022-08-30 19:04:32 +02:00
package.json dev - fixes and tracker version updates (#1351) 2023-06-19 19:32:00 +02:00
README.md change(tracker): fix links format 2022-12-12 17:53:40 +01:00
rollup.config.js fix (tracker): rollup mangle 2021-08-27 09:49:26 +03:00
tsconfig-base.json change(tracker): unit tests for tracker 2023-02-06 12:42:18 +01:00

OpenReplay Tracker

The main package of the OpenReplay tracker.

Documentation

For launch options and available public methods, refer to the documentation

Installation

npm i @openreplay/tracker

Usage

Initialize the package from your codebase entry point and start the tracker. You must set the projectKey option in the constructor. Its value can can be found in your OpenReplay dashboard under Preferences -> Projects.

import Tracker from '@openreplay/tracker'

const tracker = new Tracker({
  projectKey: YOUR_PROJECT_KEY,
})
tracker
  .start({
    userID: 'Mr.Smith',
    metadata: {
      version: '3.5.0',
      balance: '10M',
      role: 'admin',
    },
  })
  .then((startedSession) => {
    if (startedSession.success) {
      console.log(startedSession)
    }
  })

Then you can use OpenReplay JavaScript API anywhere in your code.

tracker.setUserID('my_user_id')
tracker.setMetadata('env', 'prod')