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