Skip to content

FluxbaseRealtime

new FluxbaseRealtime(url, token): FluxbaseRealtime

ParameterTypeDefault value
urlstringundefined
tokennull | stringnull

FluxbaseRealtime

channel(channelName, config?): RealtimeChannel

Create or get a channel with optional configuration

ParameterTypeDescription
channelNamestringChannel name (e.g., ‘table:public.products’)
config?RealtimeChannelConfigOptional channel configuration

RealtimeChannel

RealtimeChannel instance

const channel = realtime.channel('room-1', {
broadcast: { self: true, ack: true },
presence: { key: 'user-123' }
})

removeAllChannels(): void

Remove all channels

void


removeChannel(channel): Promise<"error" | "ok">

Remove a specific channel

ParameterTypeDescription
channelRealtimeChannelThe channel to remove

Promise<"error" | "ok">

Promise resolving to status

const channel = realtime.channel('room-1')
await realtime.removeChannel(channel)

setAuth(token): void

Update auth token for all channels Updates both the stored token for new channels and propagates the token to all existing connected channels.

ParameterTypeDescription
tokennull | stringThe new auth token

void