New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@web-reel/recorder

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web-reel/recorder

Lightweight session recording SDK based on rrweb

latest
Source
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

@web-reel/recorder

Lightweight session recording SDK based on rrweb

📦 Installation

npm install @web-reel/recorder

That's it! rrweb and idb will be automatically installed as dependencies.

🚀 Quick Start

Download Mode (Default)

import { WebReelRecorder } from '@web-reel/recorder';

const recorder = new WebReelRecorder({
  env: 'test',
  appId: 1,
  projectName: 'my-app',
  deviceId: 'user-123',
});

// Export session data as ZIP file (default, smaller size)
await recorder.exportLog();

// Or export as JSON
await recorder.exportLog(true, 'json');

Upload Mode (New!)

import { WebReelRecorder } from '@web-reel/recorder';

const recorder = new WebReelRecorder({
  env: 'test',
  appId: 1,
  projectName: 'my-app',
  deviceId: 'user-123',
  // Upload configuration
  uploadEndpoint: '/api/sessions',
  platform: 'web',
  jiraId: 'ISSUE-123',
});

// Upload session directly to server
await recorder.uploadLog();

When uploadEndpoint is configured, the floating button will automatically switch to upload mode with an upload icon.

Import Session Data

// Import session data from file
const fileInput = document.querySelector('input[type="file"]');
fileInput.addEventListener('change', async (e) => {
  const file = e.target.files[0];
  await recorder.importLog(file);
});

📖 Full Documentation

See docs/usage.md for complete documentation.

🔧 Features

  • ✅ DOM events recording via rrweb
  • ✅ Network request capture (fetch & XHR)
  • ✅ Console logs recording
  • ✅ IndexedDB storage
  • ZIP export (60-80% compression)
  • Direct upload to server API
  • Import/Export sessions
  • Automatic mode switching (download/upload)
  • ✅ JSON export (legacy support)
  • ✅ SSR compatible (Next.js, Nuxt, etc.)
  • ✅ TypeScript support
  • ✅ Webpack 5 compatible
  • ✅ Zero polyfills required

📝 Configuration Options

OptionTypeRequiredDescription
env'test' | 'online'YesEnvironment identifier
appIdnumberYesApplication ID
projectNamestringYesUnique project identifier
deviceIdstringNoDevice identifier
disabledDownLoadbooleanNoHide the floating button (default: false)
recordIntervalnumberNoLog retention in days (default: 2)
enableStatsbooleanNoEnable statistics upload (default: false)
uploadEndpointstringNoAPI endpoint for upload (e.g. '/api/sessions')
uploadHeadersRecord<string, string>NoCustom headers for upload requests
platformstringNoPlatform identifier for metadata (e.g. 'web', 'mobile')
jiraIdstringNoJira ticket ID for metadata

🌐 Server API Integration

The recorder can upload sessions directly to your server. Your server should implement the following endpoint:

POST /api/sessions

Request format: multipart/form-data

FieldTypeRequiredDescription
fileFileYesZIP file containing session data
platformStringNoPlatform identifier
device_idStringNoDevice identifier
jira_idStringNoJira ticket ID

Response format:

{
  "success": true,
  "session": {
    "id": 123,
    "created_at": "2024-01-15T10:30:00.000Z"
  }
}

See the main project documentation for complete API specification.

📄 License

MIT

Keywords

rrweb

FAQs

Package last updated on 25 Oct 2025

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