Skip to content

How-to guides

Task-oriented recipes — each solves one problem and assumes you know the basics. If you don't, start with the Tutorials for a guaranteed-success build, then come back here to get a specific thing done.

Contract & interactions

The three wire patterns declared on one contract, plus the cross-node bus.

  • Requests — typed request/response calls with validated inputs and results.
  • Events & rooms — push server events to a client, a room, or everyone.
  • Topics — let clients subscribe to server-owned streams and authorize each subscribe.
  • Cluster event busserver.publish/server.subscribe across nodes with local echo.

Transports

The pluggable client↔server wire. Pick one, then wire it on both ends.

Authentication

Prove who's on a connection — the connect-time primitive, or the batteries-included plugin.

Collections

Where typed collection state lives, and how it reaches other nodes.

Queues & workers

Server

Authorize, extend, and observe the server-authoritative core.

  • Connection env — vend typed, server-owned per-connection state the client reads live.
  • Chat backbone — add channels, membership control, and messages via @super-line/plugin-chat.
  • Plugin-chat 0.5 migration — move from assembled feeds and bot helpers to durable per-message parts and host-owned automation policy.
  • Migrate to the one React bindingRegister moved to @super-line/react, plugin-auth/react shrank to the session owner, chat auto-builds its client, useRequest unified.
  • Chat streaming — store an agent's whole turn as typed parts that stream live and survive reloads.
  • Chat bots — run an LLM as a regular authenticated user over its own connection.
  • Chat resources — attach your CRDT documents to channels with membership-gated access.
  • Chat headless — drive a channel from scripts over a stdin/stdout line protocol.
  • Middleware & lifecycle — hook connect, disconnect, and per-message handling.
  • Errors — throw and handle SuperLineError across the wire.
  • Introspection & presence — inspect topology, connections, and who's online.
  • Composition — assemble a contract from surfaces with defineSurface/mergeSurfaces.
  • Building plugins — ship a paired contract-fragment plus runtime bundle.

Client

Consume the contract from the browser or Node.

  • React — bind requests, events, topics, and collections with createSuperLineHooks.
  • Serialization — control how payloads cross the wire.

Scaling

Fan out across nodes with a pluggable server↔server adapter.

Tooling & workflow

Develop, test, and operate super-line.

  • Control Center — inspect topology and live message traffic in the browser.
  • DevTools panel — debug one tab's client: in-flight requests, reconnect backoff, per-subscription routing, CRDT contents.
  • Testing — drive contracts end to end with the loopback transport.
  • AI agents — wire agents as first-class server-authoritative writers.

Want the model behind these recipes rather than the steps? See Concepts. Every export is catalogued in the API reference.

Released under the MIT License.