Initialization
Start the SDK once with your bot key and market, for example when your app launches. start does not load the chat yet: the chat page is created the first time the chat is shown. It does start the SDK's usage metrics and error reports, so if your app needs the user's consent for those, call start once the user has given it, see Privacy and Data
Start the SDK
import KindlyWebView
KindlyWebViewSDK.start(botKey: "YOUR_BOT_KEY", languageCode: "en", market: "general")Call it from application(_:didFinishLaunchingWithOptions:), from your SwiftUI App's initializer or wherever your app starts. Every member of KindlyWebViewSDK is static and can be called from any thread
A value in the wrong format is refused with an error in the log, and the call does nothing
languageCode defaults to en. The bot key, market and language code are trimmed first. A bot key is 8 to 64 letters, digits and hyphens, a market 1 to 64 letters, digits, _ and -, and a language code looks like en, nb or pt-BR. The market must be one configured for the bot, see Markets
Calling start again
Calling start again with the same bot key and market keeps the live chat and replaces only the language and the auth provider. The language applies to the next chat page; to switch the live chat, pass a language when you Launch Chat. A call without an auth provider leaves the chat without one, so pass it on every call
A different bot key or market closes the chat and starts over. The old conversation stays stored for when you switch back
Authenticated chats
Pass an auth provider to start when the chat should know who your user is, see Authentication