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

@graphorin/client

v0.8.0

Published

Reference TypeScript client for the Graphorin standalone server. Wraps the WebSocket subprotocol `graphorin.protocol.v1` (with the optional Server-Sent Events fallback for proxy-restricted environments) behind an ergonomic `GraphorinClient` class: `connec

Downloads

720

Readme

@graphorin/client

Reference TypeScript client for the Graphorin standalone server.

License: MIT Node.js: 22+

@graphorin/client is the reference TypeScript client for the Graphorin standalone server. It wraps the WebSocket subprotocol graphorin.protocol.v1 (with an optional Server-Sent Events fallback for proxy-restricted environments) behind an ergonomic GraphorinClient class.

What ships in v0.1 (Phase 14b)

| Capability | Detail | |---|---| | WebSocket transport | Honours the graphorin.protocol.v1 subprotocol; supports both bearer-token (Node SDK) and ticket-flow (browser) authentication. | | SSE fallback | Read-only fetch-streaming SSE transport (not EventSource) for environments that block WebSocket upgrades. It carries only the bound session stream, so it needs the sessionId client option and bearer auth; control-plane operations (subscribe, cancel, resume) fall back to REST. | | Async-iterable subscriptions | for await (const event of sub.events()) - typed AgentEvent / WorkflowEvent payload via @graphorin/protocol. | | Reconnect | Exponential backoff with full jitter; resubscribes with the recorded lastEventId so the server replays buffered events. | | Bundle hygiene | Browser-friendly. Zero Node-only dependencies; runtime depends only on @graphorin/protocol and zod. |

Direct dependencies

  • @graphorin/protocol - single source of truth for the wire format.
  • zod (^3.25.0) - schema validation re-exported transitively through @graphorin/protocol.

Install

pnpm add @graphorin/client @graphorin/protocol zod

Other npm-registry-compatible package managers (npm, yarn, bun) work identically.

Usage

import { GraphorinClient } from '@graphorin/client';

const client = new GraphorinClient({
  baseUrl: 'wss://graphorin.example.com',
  auth: { kind: 'bearer', token: process.env.GRAPHORIN_TOKEN ?? '' },
  transport: 'auto', // try WebSocket first, fall back to SSE
});

await client.connect();

const subscription = await client.subscribe({
  target: 'agent',
  id: 'echo',
  runId: 'run-123',
});

for await (const event of subscription.events()) {
  console.log(event.type, event.payload);
}

await client.cancel('run-123', { drain: false });
await client.disconnect();

Browser ticket flow

const client = new GraphorinClient({
  baseUrl: 'https://graphorin.example.com',
  auth: {
    kind: 'ticket',
    ticketProvider: async () => {
      const res = await fetch('/v1/session/ws-ticket', {
        method: 'POST',
        headers: { Authorization: `Bearer ${browserToken}` },
      });
      const body = (await res.json()) as { ticket: string };
      return body.ticket;
    },
  },
});

The client attaches the ticket as a second Sec-WebSocket-Protocol token (ticket.<value>), per the wire contract documented in @graphorin/protocol.

License

MIT © 2026 Oleksiy Stepurenko. See LICENSE.


Project Graphorin · v0.8.0 · MIT License · © 2026 Oleksiy Stepurenko · https://github.com/o-stepper/graphorin