@rrweb/record
Overview
This package contains all the record related code in rrweb and is designed to be published in a frontend app/webpage. See Getting Started in the rrweb guide for more information including the record options.
For websocket based recording against the rrweb Cloud API use the browser-client which builds on this package and accepts the same record options.
Installation
1) Bundler / npm (Recommended)
npm install @rrweb/recordimport { record } from '@rrweb/record';2) Browser Without Bundler (ESM)
Use the CDN-hosted @rrweb/record browser asset when loading directly in the browser:
<script type="module">
import { record } from 'https://cdn.rrweb.com/record/current/dist/record.js';
</script>Use current for the latest stable release, or pin an exact version such as https://cdn.rrweb.com/record/2.0.0/dist/record.js for immutable production URLs.
3) Legacy Direct <script> Include (UMD fallback)
Use this only for compatibility with non-module environments.
<script src="https://cdn.rrweb.com/record/current/dist/record.umd.cjs"></script>The legacy UMD global is rrwebRecord.
Usage
import { record } from '@rrweb/record';
record({
emit(event) {
// send event to server
},
});Notes
Currently this package is really just a wrapper around the record function in the main rrweb package. All record related code will get moved here in the future.
Release Notes for @rrweb/record
2.1.1
Patch Changes
- Updated dependencies []:
- rrweb@2.1.1
- @rrweb/types@2.1.1
- @rrweb/utils@2.1.1
2.1.0
Patch Changes
#1865
b08a06fThanks @eoghanmurray! - Fix conversion of absolute to relative urls if url contains a hashUpdated dependencies [
7f0f75f,6fe4fed]:- rrweb@2.1.0
- @rrweb/types@2.1.0
- @rrweb/utils@2.1.0
2.0.1
Patch Changes
- Updated dependencies [
5f52d63]:- rrweb@2.0.1
- @rrweb/utils@2.0.1
- @rrweb/types@2.0.1
2.0.0
Major Changes
#1762
22bc4c3Thanks @Juice10! - BREAKING CHANGE: Rename UMD global names fromrrwebtorrwebRecordfor the recorder andrrwebReplayfor the replayer. This avoids conflicts when both are loaded on the same page.#1497
2606a2aThanks @Juice10! - Distributed files have new filenames, paths and extensions. Important: If you reference distributed files or types directly, you might have to update your paths/filenames. E.g. you import fromrrweb/typings/...orrrdom/es. However you runimport rrweb from 'rrweb'you won't notice a difference with this change. If you include rrweb files directly in a script tag, you might have to update that path to include a the.umd.cjsfiles instead. All.jsfiles now use ES modules which can be used in modern browsers, node.js and bundlers that support ES modules. All npm packages now also ship.cjsand.umd.cjsfiles. The.umd.cjsfiles are CommonJS modules that bundle all files together to make it easy to ship one file to browser environments (similar to the previous.jsfiles). The.cjsfiles are CommonJS modules that can be used in older Node.js environments. Types should be better defined inpackage.jsonand if you need specific types they might be exported from new packages (for examplePlayerMachineStateandSpeedMachineStateare now exported from@rrweb/replay). Check thepackage.json'smainandexportsfield for the available files.#1497
2606a2aThanks @Juice10! - Remove the rrweb-all.js, rrweb-record.js, and rrweb-replay.js files fromrrwebpackage. Now you can use@rrweb/all,@rrweb/record, and@rrweb/replaypackages instead. Check out the README of each package for more information or check out PR #1033 to see the changes.
Patch Changes
db20184Thanks @Juice10! - Keep package version in sync with other packages#1762
22bc4c3Thanks @Juice10! - Drop base64 inlined worker source from all bundles#1515
8059d96Thanks @okejminja! - Added support for deprecated addRule & removeRule methods#1777
3b8daa6Thanks @arredgroup! - Validate if WebGLRenderingContext exists before capturing it#1631
88ea2d0Thanks @pauldambra! - Move patch function into @rrweb/utils to improve bundling#1597
bd9eb70Thanks @pauldambra! - Correctly detect when angular has wrapped mutation observer#1837
527d9d3Thanks @Juice10! - Tree-shake replay-onlypostcsscode from the@rrweb/recordbundle.#1704
33e01f5Thanks @eoghanmurray! - Provide a /umd/ output folder alongside the /dist/ one so that we can serve UMD (Universal Module Definition) files with a .js extension, without upsetting expectations set by package.json that all .js files in /dist/ are modulesUpdated dependencies [
6db8f71,0f0a532,7103625,a2c8a1a,3d1877c,af0962c,57a940a,e65465e,d872d28,36da39d,b5e30cf,40bbc25,22bc4c3,11f6567,490b3e2,dc20cd4,3e9e42f,f27e545,7261c43,03b5216,ae6908d,46f1b25,e0f862b,cbbd1e5,a6893f7,8aea5b0,267e990,68076b7,9c6edfe,a1ec9a2,8059d96,bfe14c5,4014305,efdc167,88ea2d0,609b7fa,f6f07e9,1e0b273,1fe39ab,490b3e2,979d2b1,1385f7a,d7c72bf,ebcbe8b,123a81e,05478c3,fc390a9,bbbfa22,e96f668,58c9104,227d43a,bc84246,d2582e9,aa79db7,82f6fec,2606a2a,980a38c,2606a2a,a225d8e,a82a3b4,5c27b76,b149cf3,a2be77b,227d43a,527d9d3,79837ac,a7c33f2,43e4f5b,3cc4323,d38893f,6f4e691,d7cf8dd,335639a,123a81e,04ee6ed,5fbb904,1e6f71b,d08624c,2606a2a,123a81e,314a8dd,5a78938,3416c3a,7c0dc9d,8e47ca1,53b83bb,9cd28b7,07ac5c9,33e01f5,02f50d2,502d15d,d0fbe23,a3de582,e08706a,8d209a6,be6bf52,aaabdbd,1e6f71b,6388fb5,c278d06,4cb4d0e,5e6c132]:- @rrweb/utils@2.0.0
- @rrweb/types@2.0.0
- rrweb@2.0.0
2.0.0-alpha.20
Patch Changes
- Updated dependencies [
6388fb5]:- rrweb@2.0.0-alpha.20
- @rrweb/utils@2.0.0-alpha.20
- @rrweb/types@2.0.0-alpha.20
2.0.0-alpha.19
Patch Changes
#1631
88ea2d0Thanks @pauldambra! - Move patch function into @rrweb/utils to improve bundlingUpdated dependencies [
dc20cd4,3e9e42f,a6893f7,88ea2d0,fc390a9,79837ac,6f4e691,9cd28b7]:- rrweb@2.0.0-alpha.19
- @rrweb/utils@2.0.0-alpha.19
- @rrweb/types@2.0.0-alpha.19
2.0.0-alpha.18
Patch Changes
#1597
bd9eb70Thanks @pauldambra! - Correctly detect when angular has wrapped mutation observerUpdated dependencies [
04ee6ed,5fbb904,5a78938,53b83bb]:- rrweb@2.0.0-alpha.18
- @rrweb/types@2.0.0-alpha.18
2.0.0-alpha.17
Patch Changes
db20184Thanks @Juice10! - Keep package version in sync with other packages#1515
8059d96Thanks @okejminja! - Added support for deprecated addRule & removeRule methodsUpdated dependencies [
40bbc25,68076b7,8059d96,335639a,be6bf52]:- rrweb@2.0.0-alpha.17
- @rrweb/types@2.0.0-alpha.17
2.0.0-alpha.15
Major Changes
#1497
2606a2aThanks @Juice10! - Distributed files have new filenames, paths and extensions. Important: If you reference distributed files or types directly, you might have to update your paths/filenames. E.g. you import fromrrweb/typings/...orrrdom/es. However you runimport rrweb from 'rrweb'you won't notice a difference with this change. If you include rrweb files directly in a script tag, you might have to update that path to include a the.umd.cjsfiles instead. All.jsfiles now use ES modules which can be used in modern browsers, node.js and bundlers that support ES modules. All npm packages now also ship.cjsand.umd.cjsfiles. The.umd.cjsfiles are CommonJS modules that bundle all files together to make it easy to ship one file to browser environments (similar to the previous.jsfiles). The.cjsfiles are CommonJS modules that can be used in older Node.js environments. Types should be better defined inpackage.jsonand if you need specific types they might be exported from new packages (for examplePlayerMachineStateandSpeedMachineStateare now exported from@rrweb/replay). Check thepackage.json'smainandexportsfield for the available files.#1497
2606a2aThanks @Juice10! - Remove the rrweb-all.js, rrweb-record.js, and rrweb-replay.js files fromrrwebpackage. Now you can use@rrweb/all,@rrweb/record, and@rrweb/replaypackages instead. Check out the README of each package for more information or check out PR #1033 to see the changes.