npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pulselabs-ai/web-sdk

v1.0.2

Published

Flight Recorder Web Sdk

Readme

WebSdk Library

Overview

WebSdk is a JavaScript/TypeScript library that provides screen recording capabilities with feedback collection functionality for web applications. It includes features like customizable recording duration, introduction popups, and replay capabilities.

Table of Contents

Installation

npm install @pulselabs-ai/web-sdk
# or
yarn add @pulselabs-ai/web-sdk

Basic Usage

React Example

import { WebSdk } from '@pulselabs-ai/web-sdk';

function App() {
  useEffect(() => {
    // Initialize WebSdk
    const webSdk = new WebSdk();

    // Configure and start recording
    webSdk.initRecording({
      apiKey: "your-api-key-here",
      initRecording: true,
      hideIntroductionPopup: false,
    });
  }, []);

  return (
    // Your app content
  );
}

Angular Example

Usage in Angular Component

import { Component, OnInit } from "@angular/core";
import { WebSdk } from "@pulselabs-ai/web-sdk";

@Component({
  selector: "app-root",
  template: ` <!-- Your component template --> `,
})
export class AppComponent implements OnInit {
  private webSdk: WebSdk;

  constructor() {
    this.webSdk = new WebSdk();
  }

  ngOnInit() {
    this.initializeWebSdk();
  }

  private async initializeWebSdk() {
    await this.webSdk.initRecording({
      apiKey: "your-api-key-here",
      initRecording: true,
      hideIntroductionPopup: false,
    });
  }

  // Optional: Method to manually start recording
  startRecording() {
    this.webSdk.startRecording();
  }

  // Optional: Method to manually stop recording
  stopRecording() {
    this.webSdk.stopRecording();
  }

  ngOnDestroy() {
    // Clean up when component is destroyed
    this.webSdk.stopRecording();
  }
}

Usage in Angular Service

import { Injectable } from "@angular/core";
import { WebSdk } from "@pulselabs-ai/web-sdk";

@Injectable({
  providedIn: "root",
})
export class WebSdkService {
  private webSdk: WebSdk;

  constructor() {
    this.webSdk = new WebSdk();
  }

  async initialize(config: {
    apiKey: string;
    initRecording?: boolean;
    hideIntroductionPopup?: boolean;
  }) {
    await this.webSdk.initRecording({
      apiKey: config.apiKey,
      initRecording: config.initRecording,
      hideIntroductionPopup: config.hideIntroductionPopup,
    });
  }

  startRecording(): void {
    this.webSdk.startRecording();
  }

  stopRecording(): void {
    this.webSdk.stopRecording();
  }
}

Using the Service in Components

import { Component } from "@angular/core";
import { WebSdkService } from "./web-sdk.service";

@Component({
  selector: "app-root",
  template: `
    <button (click)="startRecording()">Start Recording</button>
    <button (click)="stopRecording()">Stop Recording</button>
  `,
})
export class AppComponent {
  constructor(private webSdkService: WebSdkService) {
    this.initializeWebSdk();
  }

  private async initializeWebSdk() {
    await this.webSdkService.initialize({
      apiKey: "your-api-key-here",
      initRecording: true,
      hideIntroductionPopup: false,
    });
  }

  startRecording() {
    this.webSdkService.startRecording();
  }

  stopRecording() {
    this.webSdkService.stopRecording();
  }
}

Angular Module Configuration

import { NgModule } from "@angular/core";
import { WebSdkService } from "./web-sdk.service";

@NgModule({
  // ... other module configurations
  providers: [WebSdkService],
})
export class AppModule {}

API Reference

WebSdk Class

Constructor

const webSdk = new WebSdk();

Creates a new instance of WebSdk and initializes required styles.

Methods

initRecording
async initRecording(config: {
  apiKey: string;
  initRecording?: boolean;
  blockClass?: string;
  ignoreClass?: string;
  hideIntroductionPopup?: boolean;
}): void

Initializes the recording functionality with the following configuration options:

| Parameter | Type | Required | Default | Description | | --------------------- | ------- | -------- | ------- | -------------------------------------------------- | | apiKey | string | Yes | - | Your API key for authentication | | initRecording | boolean | No | false | Automatically start recording after initialization | | blockClass | string | No | - | CSS class to exclude elements from recording | | ignoreClass | string | No | - | CSS class to ignore elements during recording | | hideIntroductionPopup | boolean | No | false | Hide the introduction popup |

startRecording
startRecording(): void

Manually starts the recording session.

stopRecording
stopRecording(): void

Manually stops the recording session and cleans up resources.

Configuration Options

Screen Recording Duration

The default screen recording duration is set to 15 seconds. This is defined as:

Capture Methods

The library supports multiple capture methods that are loaded automatically during initialization.

  1. Shake your cursor
  2. CTRL+ALT+S / CTRL+OPTION+S
  3. Feedback button

Events and Callbacks

Recording Stop Callback

When recording stops, the library automatically:

  1. Sets recording state to false
  2. Shows a replay dialog with the recorded events
  3. Provides an option to start a new recording

Introduction Popup

The library includes a built-in introduction popup that can be:

  • Shown by default on first use
  • Disabled via configuration

Complete Implementation Example

import WebSdk from "web-sdk";

class MyApplication {
  private webSdk: WebSdk;

  constructor() {
    this.webSdk = new WebSdk();
  }

  async initialize() {
    // Initialize with full configuration
    await this.webSdk.initRecording({
      apiKey: "your-api-key-here",
      initRecording: true,
      blockClass: "no-record",
      ignoreClass: "ignore-record",
      hideIntroductionPopup: false,
    });
  }

  startManualRecording() {
    this.webSdk.startRecording();
  }

  stopManualRecording() {
    this.webSdk.stopRecording();
  }
}

Best Practices

  1. Initialization: Always initialize WebSdk after your application has fully loaded.
  2. API Key: Keep your API key secure and never expose it in client-side code.
  3. Resource Management: Call stopRecording() when cleaning up your application.

Browser Compatibility

The library is compatible with modern browsers that support:

  • ES6+ features
  • Web APIs for screen recording
  • Modern DOM manipulation

Dependencies

The library depends on several internal modules:

  • RRWebScript for recording functionality

Notes

  • The library prevents multiple instances by checking for existing feedback containers
  • Recording sessions are automatically managed and cleaned up
  • The library includes built-in styling through SCSS
  • Capture methods are cached after initial loading

License

This SDK is proprietary and subject to the restrictions outlined in our Terms and Conditions.

Contributing

[Add contribution guidelines here]

Support

[Add support information here]