A Stream gives your game (or any live app) realtime rooms over WebSocket: players join a room, publish messages on named channels, and instantly receive everything happening in that room — presence included. You bring your own identity (your player ids), FlowFn brings the infrastructure.
Streams are available on Pro plans and above. On other plans the Streams page shows an upgrade prompt; anything a team built before a plan change stays intact and unlocks again on upgrade.
Create a stream
- Open Streams in the dashboard and click New stream. Pick the app it belongs to.
- Add channels — named pipes for kinds of messages, like
state,chat,events. Each channel has an authority: Players (anyone may publish), Server (only your game server may publish), or FlowFn (nobody publishes over the socket — reserved for FlowFn-side replies players can hear but never write, perfect for AI or system announcements). - Optionally set a per-channel message rate limit, the max members per room, and how long an idle room lives.
Connect
Clients connect to the WebSocket URL shown on the stream page, naming the stream by its public code. Three ways to authenticate:
- Open identity (prototyping): turn the toggle on and connect with any
user_id— fastest way to see two clients talking. - Signed player tokens (recommended): your game server calls the public token endpoint with the stream's server key to mint a short-lived token asserting the player's id, display name, and optionally the exact rooms they may join. Players connect with the token; FlowFn verifies it instantly with no callback to your server. Rotating the server key invalidates every outstanding token and disconnects sessions that used one.
- Server key: your game server connects with the key itself and gets the server role — it may publish on Server-authority channels and into any live room without joining. Keep the key on your server; never ship it in a client build.
No server yet? Generate test token on the stream page mints a short-lived token so you can try the gateway from anywhere.
Rooms and presence
Rooms are created by joining them — join a room name and you receive its member list; everyone else hears peer_joined / peer_left as players come and go. The Live section of the stream page shows current rooms, occupancy, and connection counts; the Recent activity feed below it shows connections, joins, kicks, and every automation the stream ran (entries expire after 3 days).
Limits and disconnect codes
Streams per team, concurrent connections, concurrent rooms, and per-connection message rates come from your plan; per-channel rate limits are yours to set. A client that keeps publishing past its rate limit is disconnected (close code 4008). Disabling a stream disconnects everyone (4003); rotating the server key disconnects server and token sessions (4001); a brief 4009 means FlowFn is restarting that connection point — just reconnect.