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

@livepeer-frameworks/api

v0.3.0

Published

Typed client for the FrameWorks GraphQL API: operations, retries, pagination, typed errors, uploads, playback tokens, and webhooks

Downloads

640

Readme

@livepeer-frameworks/api

Typed client for the FrameWorks GraphQL API. It ships a typed document for every public root field and argument-taking field of the public schema, typed custom selections, and the parts every integration writes by hand otherwise: retries, pagination, typed errors, a server version check, VOD uploads, playback token signing, and webhook verification.

The Go (github.com/Livepeer-FrameWorks/sdk-go) and Python (livepeer-frameworks) SDKs are generated from the same schema and operations and share this package's version.

npm install @livepeer-frameworks/api
# subscriptions only:
npm install graphql-ws

Node 22 or later, or any browser with fetch.

import { createClient, CreateStreamDocument, expectResult } from "@livepeer-frameworks/api";

const client = createClient({
  url: "https://bridge.example.com/graphql",
  token: process.env.FRAMEWORKS_API_TOKEN,
});

const data = await client.request(CreateStreamDocument, { input: { name: "Launch stream" } });
const stream = expectResult(data.createStream, "Stream");
console.log(stream.streamKey, stream.playbackId);

| Entry | Contents | | ---------------------------------------- | --------------------------------------------------------------------- | | @livepeer-frameworks/api | client, typed documents, errors, pagination, uploads, playback tokens | | @livepeer-frameworks/api/subscriptions | WebSocket subscriptions (needs the graphql-ws peer dependency) | | @livepeer-frameworks/api/select | typed custom selections over the whole public schema | | @livepeer-frameworks/api/webhooks | webhook signature verification and typed event parsing |

Custom selections

Every public root field and argument-taking field has a generated document with a default selection. For fields beyond it, @livepeer-frameworks/api/select builds typed operations from selection objects (generated with Genql from the public schema) and sends them through an existing client, so authentication, retries, typed errors, and the server version check are the same as for client.request:

import { createClient } from "@livepeer-frameworks/api";
import { createSelectClient } from "@livepeer-frameworks/api/select";
import { createSubscriptionClient } from "@livepeer-frameworks/api/subscriptions";

const select = createSelectClient(createClient({ url, token }), {
  subscriptions: createSubscriptionClient({ url: wsUrl, token }), // only for subscription()
});

const { stream } = await select.query({
  stream: { __args: { id }, name: true, metrics: { status: true, currentViewers: true } },
});

const { createStream } = await select.mutation({
  createStream: {
    __args: { input: { name: "Launch stream" } },
    __typename: true,
    on_Stream: { id: true, streamKey: true },
    on_ValidationError: { message: true, field: true },
  },
});

__args passes arguments, on_<Type> selects a union member or interface implementation, and __scalar: true selects every scalar field of a level that needs no argument. __scalar is refused at the mutation and subscription roots: name each root field the operation runs. A selected field the schema does not have throws TypeError before anything is sent. Results are typed from the selection: a union or interface result is the union of its members, each with __typename (always selected there, so the result can be narrowed) and only the fields its branches select. __name names the operation, and may not reuse an SDK operation name. The entry carries the schema's type map (about 20 kB gzipped), which the main entry does not include.

Versions

The SDK is 0.x until the platform reaches 1.0. Each minor line (0.1, 0.2, ...) supports every FrameWorks release from its minimum server version on; a new minor line may drop operations or raise the minimum. The client checks the server's serverInfo, shared per URL and read again after five minutes, and throws ServerTooOldError against an older release.

Documentation: https://logbook.frameworks.network/builders/sdks