@priemskiyyy/simulcast-partykit
v0.4.0
Published
PartyKit and PartyServer adapter for simulcast, built on partysocket.
Maintainers
Readme
@priemskiyyy/simulcast-partykit
PartyKit and PartyServer adapter for simulcast, built on partysocket. Requires partysocket 1.
Installation
pnpm add @priemskiyyy/simulcast @priemskiyyy/simulcast-partykit partysocketCreate a client
import { RealtimeClient } from "@priemskiyyy/simulcast";
import { partykit } from "@priemskiyyy/simulcast-partykit";
const realtime = new RealtimeClient({
adapter: partykit({
host: "chat.example.partykit.dev",
party: "chat",
query: () => ({ token: readToken() }),
}),
});Behavior
A channel is a room: subscribing to realtime.channel("lobby") opens one PartySocket to that room and every message on it becomes a publication with the raw event.data in data and the MessageEvent in native. Parse in useChannel with parse. The options are PartySocket's own, minus room.
There is no shared connection, so a session reports connected immediately and each room carries its own state: subscribing until the socket opens or while partysocket reconnects, subscribed while open. The connection-level realtime.native.get() is null; the high-level channel handle exposes subscription and status, not the room socket. This adapter receives room messages. Use a separate application publishing path when you need to send.
Guides
- Installation and framework setup
- Adapter configuration and state mappings
- Connection sessions
- Testing consumers without a provider
