Options

data class Options(val key: String = UUID.randomUUID().toString(), val apiKey: String? = null, val fetchAuthToken: suspend (shouldRefresh: Boolean) -> String? = null, val syncLoopDuration: Duration = 50.milliseconds, val reconnectStreamDelay: Duration = 1_000.milliseconds)

User-settable options used when defining Client.

Constructors

Link copied to clipboard
constructor(key: String = UUID.randomUUID().toString(), apiKey: String? = null, fetchAuthToken: suspend (shouldRefresh: Boolean) -> String? = null, syncLoopDuration: Duration = 50.milliseconds, reconnectStreamDelay: Duration = 1_000.milliseconds)

Properties

Link copied to clipboard
val apiKey: String? = null

API key of the project used to identify the project.

Link copied to clipboard
val fetchAuthToken: suspend (shouldRefresh: Boolean) -> String? = null

fetchAuthToken provides a token for the auth webhook. When the webhook response status code is 401, this function is called to refresh the token. The reason parameter is the reason from the webhook response.

Link copied to clipboard
val key: String

Client key used to identify the client. If not set, a random key is generated.

Link copied to clipboard

Delay of the reconnect stream. If the stream is disconnected, the client waits for the delay to reconnect the stream. The default value is 1000(ms).

Link copied to clipboard

Duration of the sync loop. After each sync loop, the client waits for the duration to next sync. The default value is 50(ms).