@priemskiyyy/simulcast-phoenix
v0.4.0
Published
Phoenix Channels adapter for simulcast.
Maintainers
Readme
@priemskiyyy/simulcast-phoenix
Phoenix Channels adapter for simulcast. Requires phoenix 1.7 or newer.
Installation
pnpm add @priemskiyyy/simulcast @priemskiyyy/simulcast-phoenix phoenixCreate a client
import { RealtimeClient } from "@priemskiyyy/simulcast";
import { phoenix } from "@priemskiyyy/simulcast-phoenix";
const realtime = new RealtimeClient({
adapter: phoenix({
url: "wss://example.com/socket",
options: { params: { token } },
getChannelParams: (channel) => ({ token: channelToken(channel) }),
}),
});Behavior
A channel is a Phoenix topic. Every event the server pushes on it becomes a publication whose event is the event name and whose native holds the event, payload, and ref; phx_ and reply frames are not publications. A successful join reports subscribed; rejected joins report the reason as an error and subscribing. A timed out join reports subscribing without a separate error. Phoenix keeps rejoining until the channel leaves. The socket reports connecting after every close for the same reason.
Guides
- Installation and framework setup
- Adapter configuration and state mappings
- Connection sessions
- Testing consumers without a provider
