Chat Kindly SDK
Main implementation of the Kindly Chat SDK. Use the companion object methods (e.g., KindlySDK.start(), KindlySDK.launchChat()) to interact with the SDK.
Parameters
The application context.
The bot key for the Kindly Chat API.
The language code to use (default is "en").
The behavior type for the SDK. Currently only BehaviorType.NATIVE is supported.
Constructors
Properties
The SDK configuration for permissions and theme settings.
Whether the SDK should send crash reports via Sentry. Defaults to true.
Unified event flow for all Kindly events (matches web API pattern) Subscribe to this to receive all events: load, message, buttonClick, ui, globalIcon, state
Flow that emits input field visibility changes Subscribe to this to get real-time updates when input field should be hidden or shown
Optional delegate for receiving button press and link interception callbacks.
Unified state flow that emits state change events Subscribe to this to get real-time updates of: isChatDisplayed, isConnected, isStarted, isSocketConnected
Whether verbose logging is enabled. Defaults to false.
Functions
Handovers the call from the chatBot.
Clears any custom theme that has been set and reverts to the default theme.
Clears the current context of the chat.
Clears any pending trigger dialogue request.
Displays the chat UI. This should only be called after the connection is established.
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.
Handles an incoming Firebase push notification. Call this from your FirebaseMessagingService.
Gets the current input field visibility state.
Checks if a notification is from Kindly.
Opens the chat bot after connecting to the Kindly service.
Saves the Firebase Cloud Messaging token for push notifications.
Send a message on behalf of the user, programmatically.
Sets a custom theme for the chat UI.
Sets a custom theme using individual color parameters. Only specified colors (non-null) will override the default theme.
Manually controls input field visibility. This will override any automatic visibility settings from messages or global settings.
Updates the language for the current SDK session. This will be used for all subsequent chat connections and UI elements.
Sets a new context for the chat.
Initializes the Kindly Chat SDK. This is the first method that should be called before using any other SDK functions. The SDK will automatically use NATIVE behavior for optimal performance and compliance.
Triggers a dialog for the provided id.