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

@bentolabs/sdk

v2.0.2

Published

BentoLabs SDK for user session recording and analytics

Readme

BentoLabs SDK

A TypeScript SDK for user session recording and analytics using rrweb.

CI/CD Pipeline Code Quality npm version

Installation

npm install @bentolabs/sdk

CI/CD Pipeline

This project includes a streamlined CI/CD pipeline with:

  • Release-Triggered Builds - Only runs when you create a GitHub release
  • Automated Testing on Node.js 18.x
  • Code Quality Checks (ESLint, Prettier, TypeScript)
  • Automated Build and validation
  • Automated NPM Publishing on releases
  • Dependency Management with Dependabot

Quick Setup

  1. Set NPM Token: Add NPM_TOKEN to GitHub repository secrets
  2. Create Release: Tag and release on GitHub to automatically build, test, and publish to npm

See DEPLOYMENT.md for detailed setup instructions.

Quick Start

import { BentoLabsSDK } from '@bentolabs/sdk';

// Create SDK instance
const sdk = new BentoLabsSDK();

// Initialize with your API key
sdk.init('your-api-key', {
  endpoint: 'https://api.bentolabs.ai',
  debug: true,
});

// Check status
console.log('Session ID:', sdk.getSessionId());
console.log('Recording:', sdk.isRecordingActive());

API Reference

Initialization

init(apiKey: string, options?: SDKOptions)

Initialize the SDK with your API key and optional configuration.

Parameters:

  • apiKey (string): Your BentoLabs API key
  • options (SDKOptions, optional): Configuration options

Options:

interface SDKOptions {
  endpoint?: string; // API endpoint URL (default: 'https://api.bentolabs.ai')
  debug?: boolean; // Enable debug logging (default: false)
}

Example:

sdk.init('your-api-key', {
  endpoint: 'https://custom-endpoint.com',
  debug: true,
});

Methods

getSessionId(): string

Returns the current session ID.

const sessionId = sdk.getSessionId();
console.log('Current session:', sessionId); // sess_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

isRecordingActive(): boolean

Check if recording is currently active.

if (sdk.isRecordingActive()) {
  console.log('Recording user interactions...');
}

getConfig(): Omit<SDKConfig, 'apiKey'> & { apiKey: string }

Get current configuration with masked API key for security.

const config = sdk.getConfig();
console.log(config);
// {
//   apiKey: 'your-api...',
//   endpoint: 'https://api.bentolabs.ai',
//   debug: false
// }

Examples

React Integration

import React, { useEffect, useState } from 'react';
import { BentoLabsSDK } from '@bentolabs/sdk';

function App() {
  const [sdk] = useState(() => new BentoLabsSDK());
  const [sessionId, setSessionId] = useState('');

  useEffect(() => {
    sdk.init('your-api-key', { debug: true });
    setSessionId(sdk.getSessionId());
  }, [sdk]);

  return (
    <div>
      <h1>My App</h1>
      <p>Session: {sessionId}</p>
      <p>Recording: {sdk.isRecordingActive() ? 'Active' : 'Inactive'}</p>
    </div>
  );
}

Vanilla JavaScript

<!DOCTYPE html>
<html>
  <head>
    <script src="https://unpkg.com/@bentolabs/sdk@latest/dist/index.js"></script>
  </head>
  <body>
    <script>
      const sdk = new BentoLabsSDK();
      sdk.init('your-api-key', { debug: true });

      console.log('Session ID:', sdk.getSessionId());
      console.log('Recording:', sdk.isRecordingActive());
    </script>
  </body>
</html>

Examples Directory

Check out the examples directory for complete working examples:

Development

Setup

# Clone the repository
git clone https://github.com/bentolabs/bentolabs-sdk.git
cd bentolabs-sdk

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Start development mode
npm run dev

Scripts

  • npm run build - Build the TypeScript project
  • npm run dev - Start TypeScript compiler in watch mode
  • npm test - Run all tests
  • npm run test:watch - Run tests in watch mode
  • npm run test:coverage - Run tests with coverage report
  • npm run lint - Run ESLint
  • npm run format - Format code with Prettier

Project Structure

bentolabs-sdk/
├── src/                 # Source code
│   └── index.ts        # Main SDK implementation
├── tests/              # Test files
│   ├── BentoLabsSDK.test.ts
│   └── integration.test.ts
├── examples/           # Example applications
│   └── react-example/  # React example
├── dist/               # Built files (generated)
├── coverage/           # Test coverage (generated)
└── .github/            # GitHub Actions workflows

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Make your changes and add tests
  4. Run tests: npm test
  5. Run linting: npm run lint
  6. Commit your changes: git commit -am 'Add my feature'
  7. Push to the branch: git push origin feature/my-feature
  8. Submit a pull request

Publishing

Stable Release

  1. Create a GitHub release with a version tag (e.g., v1.0.0)
  2. GitHub Actions will automatically publish to npm

Beta Release

  1. Push changes to the develop branch
  2. GitHub Actions will automatically publish a beta version

License

MIT License - see LICENSE file for details.

Support