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

@redseat/api

v0.3.0

Published

TypeScript API client library for interacting with Redseat servers

Downloads

4,141

Readme

@redseat/api

TypeScript API client library for interacting with Redseat servers. This package provides a comprehensive set of APIs for managing libraries, media, tags, people, series, movies, and more.

Overview

The @redseat/api package is organized into three main API classes:

  • RedseatClient: Low-level HTTP client with automatic token management and local server detection
  • ServerApi: Server-level operations (libraries, settings, plugins, credentials)
  • LibraryApi: Library-specific operations (media, tags, people, series, movies, encryption)

Quick Start

import { RedseatClient, ServerApi, LibraryApi } from '@redseat/api';
import { IServer, ILibrary } from '@redseat/api';

// Initialize the client
const client = new RedseatClient({
    server: {
        id: 'server-id',
        url: 'example.com',
        port: 443
    },
    getIdToken: async () => {
        // Return your ID token from your auth provider
        return 'your-id-token';
    }
});

// Get server API
const serverApi = new ServerApi(client);

// Get libraries
const libraries = await serverApi.getLibraries();

// Get library API for a specific library
const library = libraries[0];
const libraryApi = new LibraryApi(client, library.id!, library);

// For encrypted libraries, set the encryption key
if (library.crypt) {
    await libraryApi.setKey('your-passphrase');
}

// Get media
const medias = await libraryApi.getMedias();

Documentation

  • client.md - RedseatClient documentation

    • HTTP client configuration
    • Automatic token refresh
    • Local server detection
    • Request/response interceptors
  • server.md - ServerApi documentation

    • Server-level operations
    • Library management
    • Settings and plugins
    • Credentials management
  • libraries.md - LibraryApi documentation

    • Media operations (upload, download, update)
    • Tags, people, series, movies management
    • Face recognition operations
    • Encryption support for encrypted libraries
  • encryption.md - Encryption module documentation

    • Key derivation (PBKDF2)
    • Text and binary encryption/decryption
    • File encryption with thumbnails
    • Cross-platform compatibility
  • test.md - Testing guide

    • How to run tests
    • Test file descriptions
    • Test coverage information
  • agents.md - AI agent instructions

    • Documentation maintenance guidelines
    • Code change workflow
    • Best practices for keeping docs updated

Package Exports

Classes

  • RedseatClient - HTTP client with authentication
  • ServerApi - Server-level API operations
  • LibraryApi - Library-level API operations

Interfaces

  • IFile - Media file interface
  • ILibrary - Library interface
  • ITag - Tag interface
  • IPerson - Person interface
  • ISerie - Series interface
  • IMovie - Movie interface
  • IServer - Server interface
  • MediaRequest - Media query filter
  • And more (see src/interfaces.ts)

Encryption Functions

  • deriveKey() - Derive encryption key from passphrase
  • encryptText() / decryptText() - Text encryption
  • encryptBuffer() / decryptBuffer() - Binary encryption
  • encryptFile() / decryptFile() - File encryption with metadata
  • getRandomIV() - Generate random IV

Utilities

  • fetchServerToken() - Fetch server authentication token
  • Base64 encoding/decoding utilities
  • Crypto utilities for cross-platform support

Installation

npm install @redseat/api

Requirements

  • Node.js 15+ (for Web Crypto API support)
  • TypeScript 5.0+
  • Axios 1.11.0+

License

See the main project LICENSE file.