Config

data class Config(var websocketConfig: WebSockets.Config.() -> Unit = {}, var secure: Boolean? = null, var heartbeatInterval: Duration = 15.seconds, var reconnectDelay: Duration = 7.seconds, var disconnectOnSessionLoss: Boolean = true, var connectOnSubscribe: Boolean = true, var websocketFactory: RealtimeWebsocketFactory? = null, var disconnectOnNoSubscriptions: Boolean = true) : MainConfig, CustomSerializationConfig(source)

Constructors

Link copied to clipboard
constructor(websocketConfig: WebSockets.Config.() -> Unit = {}, secure: Boolean? = null, heartbeatInterval: Duration = 15.seconds, reconnectDelay: Duration = 7.seconds, disconnectOnSessionLoss: Boolean = true, connectOnSubscribe: Boolean = true, websocketFactory: RealtimeWebsocketFactory? = null, disconnectOnNoSubscriptions: Boolean = true)

Properties

Link copied to clipboard

Whether to connect to the websocket when subscribing to a channel. Defaults to true

Link copied to clipboard
Link copied to clipboard

Whether to disconnect from the websocket when there are no more subscriptions. Defaults to true

Link copied to clipboard

Whether to disconnect from the websocket when the session is lost. Defaults to true

Link copied to clipboard

The interval between heartbeat messages. Defaults to 15 seconds

Link copied to clipboard
Link copied to clipboard

The delay between reconnect attempts. Defaults to 7 seconds

Link copied to clipboard

Whether to use wss or ws. Defaults to SupabaseClient.useHTTPS when null

Link copied to clipboard
open override var serializer: SupabaseSerializer?

A serializer used for serializing/deserializing objects e.g. in PresenceAction.decodeJoinsAs or RealtimeChannel.broadcast. Defaults to KotlinXSerializer

Link copied to clipboard
var websocketConfig: WebSockets.Config.() -> Unit

Custom configuration for the Ktor Websocket Client. This only applies if Realtime.Config.websocketFactory is null.

Link copied to clipboard

A custom websocket factory. If this is set, the websocketConfig will be ignored