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

@cloudspe/video-core

v3.0.2

Published

Framework-free engine for an OpenAI-Mux-style video platform: VOD/Live HLS dispatch, adapter-driven billing/auth/storage, Livepeer worker pool integration.

Downloads

525

Readme

@cloudspe/video-core

Framework-free video engine for Livepeer worker pools. VOD + Live HLS dispatch with an adapter-driven billing / auth / storage / webhooks surface — bring your own. MIT.

npm install @cloudspe/video-core

The engine handles what (orchestration, manifest assembly, payment quoting, retries, webhook signing); how is your call. Wire your own Postgres + Stripe? Done. Bring your own Redis-backed rate limiter? Done. Plug into S3 / R2 / RustFS / Wasabi for storage? Done. The full adapter set is nine interfaces, each ~10 lines.

Quickstart

The examples/minimal-shell/ directory ships a runnable Fastify app (~200 LOC) that wires the engine to in-memory adapters. It's the fastest way to see the surface:

cd examples/minimal-shell
npm install
node start.js

# In another terminal:
curl -s -X POST http://localhost:8080/v1/uploads \
  -H "Authorization: Bearer demo-token" \
  -H "Content-Type: application/json" \
  -d '{"offering":"h264-1080p","encodingTier":"baseline"}' | jq

The example uses InMemoryWallet, FakeAuthResolver, and FakeStorageProvider from @cloudspe/video-core/testing — useful for kicking the tires; not for production. Real adopters supply production adapters (Postgres-backed wallet, JWT or API-key auth, S3-compatible storage).

For a fully-wired reference, see Cloud-SPE/livepeer-video-platform — the proprietary shell + worker that this engine ships out of.

The adapter surface

You implement these. The engine calls them.

| Adapter | Purpose | |---|---| | Wallet | reserve / commit / refund against a video-shaped CostQuote (time × codec × rendition × tier) | | AuthResolver | request headers / IP → Caller | | AdminAuthResolver | admin-token → { actor } | | RateLimiter | per-(callerId, capability) token bucket | | Logger | info / warn / error / debug with structured context | | StorageProvider | S3-shaped bytes transport (engine owns the path conventions) | | WebhookSink | signed delivery + retry queue | | WorkerResolver | discover workers by capability | | WorkerClient | dispatch to a worker URL with a payment ticket header | | EventBus | per-caller event emit; the WebhookSink fan-out lives here | | StreamKeyHasher | argon2id / scrypt for live stream keys (and shared with API keys) |

@cloudspe/video-core/testing exports reference fakes for every one of these. They're not for production but they let you build, test, and reason about a shell without wiring real backends first.

Dispatchers (the framework-free entry points)

import {
  dispatchUploadCreate,
  dispatchVodSubmit,
  dispatchVodStatus,
  dispatchLiveStreamCreate,
  dispatchLiveStreamStop,
  dispatchLiveStreamStatus,
  dispatchPlaybackResolve,
} from '@cloudspe/video-core';

Each dispatcher is a pure function over a DispatchCommon deps bag (plus its own input). The Fastify adapter at @cloudspe/video-core/fastify provides registerVideoRoutes(app, deps) that mounts them as HTTP routes and maps VideoCoreError → JSON envelope via toHttpError. If Fastify isn't your framework, the dispatchers work just as well behind Express, Hono, h3, or whatever you ship.

dispatchAbrSubmit + dispatchAbrStatus are stubs at MVP — the ABR-on-demand surface lands post-1.0.

Architecture

                  ┌─────────────────────────────┐
                  │  HTTP framework (Fastify,   │
                  │  Express, Hono, …)          │
                  └─────────────┬───────────────┘
                                │
                  ┌─────────────▼───────────────┐
                  │  @cloudspe/video-core      │
                  │                             │
                  │   • Dispatchers             │
                  │   • Job orchestrator        │
                  │   • Manifest builder        │
                  │   • Cost quoter             │
                  │   • Webhook signer          │
                  │   • Storage path conventions│
                  └─┬───────────────────────────┘
                    │ adapter calls
                    ▼
   ┌────────────┐  ┌──────────────┐  ┌───────────────┐
   │   Wallet   │  │ AuthResolver │  │   Storage     │
   │ (your impl)│  │ (your impl)  │  │  (your impl)  │
   └────────────┘  └──────────────┘  └───────────────┘
   …all eleven adapters configured by the operator…
                    │
                    ▼
            ┌───────────────────────┐
            │ Livepeer worker pool  │
            │ (FFmpeg + RTMP + HLS) │
            └───────────────────────┘

Optional read-only operator dashboard

@cloudspe/video-core/dashboard exports registerOperatorDashboard(app, deps) for an opt-in /admin/ops/* mount. Vanilla TS; no Lit / RxJS / Vite. Serves a small HTML page that polls /admin/ops/data.json every 5s and renders worker pool + recent assets + active live streams + recent webhook deliveries. Adopters supply a DashboardDataSource (or use the default factory createDefaultDashboardDataSource over their existing repos).

What this engine is not

  • Not a managed video platform. You run it. The engine is the middle layer; you bring storage, billing, auth, deployment.
  • Not a transcoder. The engine orchestrates work; the actual encode happens in a Livepeer worker (or any worker that satisfies the engine's capability + payment-ticket protocol).
  • Not framework-coupled. Fastify is shipped as one optional adapter. The dispatchers themselves don't import fastify or any other HTTP framework.

Documentation

Versioning

Pre-1.0: breaking changes may land in any 0.x release; documented in CHANGELOG.md. Adapter shape changes are minor bumps pre-1.0 and major bumps post-1.0. 1.0.0 cuts when the engine has been adopted by an external operator and the adapter surface has been stable across at least one release cycle.

Build + test

npm install
npm run build           # tsc → dist/
npm test                # vitest run
npm run typecheck       # tsc --noEmit
npm run lint            # eslint

Coverage gate is 75% lines / branches / functions / statements.

License

MIT — see LICENSE.

Copyright (c) 2026 Cloud-SPE contributors.