FluxbaseRealtime
Constructors
Section titled “Constructors”new FluxbaseRealtime()
Section titled “new FluxbaseRealtime()”new FluxbaseRealtime(
url,token):FluxbaseRealtime
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
url | string | undefined |
token | null | string | null |
Returns
Section titled “Returns”Methods
Section titled “Methods”channel()
Section titled “channel()”channel(
channelName,config?):RealtimeChannel
Create or get a channel with optional configuration
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
channelName | string | Channel name (e.g., ‘table:public.products’) |
config? | RealtimeChannelConfig | Optional channel configuration |
Returns
Section titled “Returns”RealtimeChannel instance
Example
Section titled “Example”const channel = realtime.channel('room-1', { broadcast: { self: true, ack: true }, presence: { key: 'user-123' }})executionLogs()
Section titled “executionLogs()”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).
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
executionId | string | undefined | The execution ID to subscribe to |
type | ExecutionType | "function" | The type of execution (‘function’, ‘job’, ‘rpc’) |
Returns
Section titled “Returns”ExecutionLogsChannel instance with fluent API
Example
Section titled “Example”const channel = client.realtime.executionLogs('exec-123', 'function') .onLog((log) => { console.log(`[${log.level}] ${log.message}`) }) .subscribe()removeAllChannels()
Section titled “removeAllChannels()”removeAllChannels():
void
Remove all channels
Returns
Section titled “Returns”void
removeChannel()
Section titled “removeChannel()”removeChannel(
channel):Promise<"error"|"ok">
Remove a specific channel
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
channel | RealtimeChannel | The channel to remove |
Returns
Section titled “Returns”Promise<"error" | "ok">
Promise resolving to status
Example
Section titled “Example”const channel = realtime.channel('room-1')await realtime.removeChannel(channel)setAuth()
Section titled “setAuth()”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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
token | null | string | The new auth token |
Returns
Section titled “Returns”void