Skip to content

FluxbaseRealtime

new FluxbaseRealtime(url, token?): FluxbaseRealtime

Parameter Type Default value
url string undefined
token string | null null

FluxbaseRealtime

channel(channelName, config?): RealtimeChannel

Create or get a channel with optional configuration

Parameter Type Description
channelName string Channel name (e.g., ‘table:public.products’)
config? RealtimeChannelConfig Optional 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).

Parameter Type Default value Description
executionId string undefined The execution ID to subscribe to
type ExecutionType "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

Parameter Type Description
channel RealtimeChannel The 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.

Parameter Type Description
token string | null The new auth token

void