Skip to content

Your own library

This section is the protocol underneath Woosh.Wisp and @woosh-no/wisp: every frame your wisp sends and hears, and every rule Woosh holds it to. Read it to write a library in another language, or to see what the libraries do for you. You never need it to build a wisp in C# or TypeScript.

  • Two HTTP requests, and only two. Your wisp’s id and secret buy a short-lived token with OAuth2’s client credentials request, and pictures for cards are uploaded as files. Nothing else a wisp does goes over HTTP.
  • One WebSocket, the line. The token’s answer names its address. Text frames carry JSON, one frame per line of text. It is the protocol the Woosh apps speak, with a few additions for wisps.
  • Calls and answers. Everything your wisp does, and every read, is a call: {"i":7,"t":"send", "d":{...}}, answered by {"r":7,"v":...} or a refusal with a reason in a code. Up to 32 may be on their way at once.
  • Numbered events. Everything your wisp hears is an event numbered in its group, such as {"c":61,"n":120,"t":"grants","d":{...}}. Keep the last number you handled, and coming back within 10 minutes replays what you missed.
  • Limits told up front. The line’s ready names your wisp’s limits, and a call past one answers limited with how long to wait.

Woosh.Wisp does each of these. A library of your own should too, and each step links to the page that has its rules:

  1. Connect. Buy a token, open the line its answer names with ?delivery=seen, send hello within 10 seconds, and wait for ready (The line).
  2. Send the commands in your user’s code after every ready, whole (Commands).
  3. Keep your place. Move the cursor past an event only once it is handled, store it, and resume with it; when ready says events were missed, catch up by reading (Keeping your place, Catching up).
  4. Come back after a drop on the backoff ready names, and act on each close code (Closes, and coming back). Follow a move to another address without a gap (Moving).
  5. Keep order. Up to 32 calls on their way, but one channel’s lines in the order they were written (32 in flight).
  6. Pace to the limits rather than bouncing off them, and keep only the newest of a burst of edits (Budgets and limits).
  7. Never post twice. Give every line a send id, so a retry after a drop is answered with the line it already made (Acting in a server).
  8. Check before sending. Hold cards and forms to their rules before they go, so a mistake is your user’s error in their own code, not a refusal later (Cards, Forms).
  9. Answer in time. A run or a press has 15 seconds; pass over one that comes back after it (Commands, Presses).
  10. Hand over. Let a second line for the same slice take over without a gap, for deploys (Hand-overs, Slices).
Page Holds
Your first wisp without a library Every request and frame, start to finish, and a whole wisp in about 70 lines of Node
The line The token, hello and ready, frames, calls, keeping your place, closes, moving, hand-overs
What a wisp hears Every event, by what the admin granted
Commands The command list, a run, and answering it
Cards Every block, its keys and limits, patches and live frames
Presses and private cards Presses, menus, tallies, private cards
Forms A form’s fields, a sending, and its rules
Acting in a server Every call that acts, and every read
Budgets and limits Every limit, how limited looks, and pacing
Slices and scale Splitting a wisp across processes
Reference Every frame, call, event, error code and HTTP route on one page
  • Real frames. Every frame on these pages is one Woosh’s own tests hold it to.
  • Every form rule as cases. /forms/rules.json holds forms and sendings, each with the answer Woosh gives, so your library can check forms exactly as Woosh does.
  • A worked library. Woosh.Wisp on NuGet is MIT licensed and does every step above.

© 2026 Woosh AS. All rights reserved.