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' }
})

executionLogs(executionId, type): ExecutionLogsChannel

Create an execution log subscription channel

This provides a cleaner API for subscribing to execution logs (functions, jobs, or RPC procedures).

ParameterTypeDefault valueDescription
executionIdstringundefinedThe execution ID to subscribe to
typeExecutionType"function"The type of execution (‘function’, ‘job’, ‘rpc’)

ExecutionLogsChannel

ExecutionLogsChannel instance with fluent API

const channel = client.realtime.executionLogs('exec-123', 'function')
.onLog((log) => {
console.log(`[${log.level}] ${log.message}`)
})
.subscribe()

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