Companion

Properties

Link copied to clipboard
open override var config: KindlySDKConfig

The SDK configuration for permissions and theme settings.

Link copied to clipboard
open override var enableCrashReporting: Boolean

Whether the SDK should send crash reports via Sentry. Defaults to true.

Link copied to clipboard
open override val events: Flow<KindlyEvent>

Unified event flow for all Kindly events (matches web API pattern) Subscribe to this to receive all events: load, message, buttonClick, ui, globalIcon, state

Link copied to clipboard

Flow that emits input field visibility changes Subscribe to this to get real-time updates when input field should be hidden or shown

Link copied to clipboard
open override var interface: KindlySDKInteraction?

Optional delegate for receiving button press and link interception callbacks.

Link copied to clipboard
lateinit var shared: ChatKindlySDK
Link copied to clipboard
open override val state: Flow<KindlyEventState>

Unified state flow that emits state change events Subscribe to this to get real-time updates of: isChatDisplayed, isConnected, isStarted, isSocketConnected

Link copied to clipboard
open override var verboseLogging: Boolean

Whether verbose logging is enabled. Defaults to false.

Functions

Link copied to clipboard

Clear any previously set settings overrides.

Link copied to clipboard

Override parts of the settings response for testing purposes. Pass a map following the same JSON hierarchy as the settings response. The overrides are deep-merged with the server response — only the keys you provide are replaced.

Link copied to clipboard

Force the logger into "show everything" mode at runtime, surfacing every log level (including VERBOSE) on production builds. Equivalent to building with WHERE_AM_I = LOCAL, but scoped to logging only — does not affect API endpoints, Pusher key, Sentry, or anything else that reads Session.whereAmI.

Link copied to clipboard
open override fun callHandover(handoverListener: CallbackHandover)

Handovers the call from the chatBot.

Link copied to clipboard
open override fun clearCustomTheme()

Clears any custom theme that has been set and reverts to the default theme.

Link copied to clipboard
open override fun clearNewContext()

Clears the current context of the chat.

Link copied to clipboard
open override fun clearTriggerDialog()

Clearing trigger dialog param call

Link copied to clipboard
open override fun close()

Closes the chat.

Link copied to clipboard
open override fun displayChat(context: Context)

Displays the chat UI. This method is kept for backward compatibility but it's recommended to use launchChat() instead which handles connection logic.

Link copied to clipboard
open override fun endChat()

Ends the chat session and disconnects from the server. This acts as a disconnect - the SDK remains initialized and can be reconnected by calling launchChat() again without needing to call start(). Use kill() if you want to completely terminate the SDK.

Link copied to clipboard
open override fun handleNotification(remoteMessage: RemoteMessage)

Handles an incoming Firebase push notification. Call this from your FirebaseMessagingService.

Link copied to clipboard
open override fun handleUrl(context: Context, uri: Uri): Boolean

Handles a Kindly URL scheme deep link. Supported format: kindly://chat/dialogue/{id}

Link copied to clipboard

Gets the current input field visibility state.

Link copied to clipboard
open override fun isKindlyNotification(remoteMessage: RemoteMessage): Boolean

Checks if a notification is from Kindly.

Link copied to clipboard
open override fun kill()

Completely kills the SDK and clears all state. After calling this method, start() must be called again before using any other SDK functions. This is more destructive than endChat() which only disconnects the chat session.

Link copied to clipboard
open override fun launchChat(context: Context, triggerDialogueId: String? = null)

Opens the chat bot after connecting to the Kindly service.

Link copied to clipboard
open override fun saveNotificationToken(token: String)

Saves the Firebase Cloud Messaging token for push notifications.

Link copied to clipboard
open override fun sendMessage(message: String, newContext: Map<String, String>? = null): Deferred<MessageChat>

Send a message on behalf of the user, programmatically.

Link copied to clipboard
open override fun setCustomTheme(theme: KindlyThemeColors)

Sets a custom theme for the chat UI.

open override fun setCustomTheme(background: Color? = null, botMessageBackground: Color? = null, botMessageText: Color? = null, buttonBackground: Color? = null, buttonOutline: Color? = null, buttonText: Color? = null, chatLogElements: Color? = null, headerBackground: Color? = null, headerText: Color? = null, inputBackground: Color? = null, inputText: Color? = null, userMessageBackground: Color? = null, userMessageText: Color? = null, maintenanceHeaderBackground: Color? = null)

Sets a custom theme using individual color parameters. Only specified colors (non-null) will override the default theme.

Link copied to clipboard

Manually controls input field visibility. This will override any automatic visibility settings from messages or global settings.

Link copied to clipboard
open override fun setLanguage(languageCode: String)

Updates the language for the current SDK session. This will be used for all subsequent chat connections and UI elements.

Link copied to clipboard
open override fun setNewContext(context: Map<String, String>)

Sets a new context for the chat.

Link copied to clipboard
open override fun start(application: Application, botKey: String, languageCode: String = "en", authTokenCallback: AuthTokenCallback? = null)

Initializes the chat SDK with the provided application, chatBotKey, and codeLanguage. The SDK will automatically use NATIVE behavior for optimal performance and compliance.

Link copied to clipboard
open override fun triggerDialogue(id: String)

Triggers a dialog for the provided id.