Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sceyt/sceyt-chat-android-uikit/llms.txt

Use this file to discover all available pages before exploring further.

Calling SceytChatUIKit.initialize() in your Application.onCreate() is the first and most important step before using any part of the SDK. During initialization the UIKit wires its internal Koin dependency-injection graph, sets up the Room persistence database, bootstraps emoji support (via EmojiCompat and the Google emoji provider), and initializes the underlying ChatClient connection layer. Every other API on SceytChatUIKit — theming, providers, navigators, and so on — becomes safe to access only after this call completes.

SceytChatUIKit.initialize()

@JvmStatic
@JvmOverloads
fun initialize(
    appContext: Context,
    apiUrl: String,
    appId: String,
    clientId: String,
    enableDatabase: Boolean = true,
)

Parameters

appContext
Context
required
The Android application Context. Pass applicationContext from your Application subclass — the SDK holds a strong reference to this value internally and uses it to bootstrap Room, WorkManager, and push notification services.
apiUrl
String
required
The WebSocket API endpoint for your Sceyt application. Typically in the form wss://<your-app-id>.sceyt.com. You can find this value in the Sceyt dashboard under your app’s connection settings.
appId
String
required
The unique identifier of your Sceyt application. This is different from your Android app’s package name — it is issued by Sceyt when you create a new application in the dashboard.
clientId
String
required
A stable, device-unique string used to identify this particular client instance. A common choice is a UUID persisted to SharedPreferences on first launch, ensuring the same device always presents the same clientId across sessions.
enableDatabase
Boolean
default:"true"
Controls whether the local Room database is created and used for offline caching of channels, messages, and members. Set to false to run in a memory-only mode — useful for guest flows or scenarios where you do not want data persisted to disk.

Basic setup

Place the call inside your custom Application class so the SDK is ready before any Activity or Service starts:
class MyApplication : Application() {

    override fun onCreate() {
        super.onCreate()

        SceytChatUIKit.initialize(
            appContext   = applicationContext,
            apiUrl       = "wss://your-app-id.sceyt.com",
            appId        = "your-app-id",
            clientId     = getOrCreateClientId(),   // stable UUID from SharedPreferences
            enableDatabase = true
        )
    }
}
Register the class in AndroidManifest.xml:
<application
    android:name=".MyApplication"
    ... >

Koin integration

The UIKit uses Koin internally. If your own app already calls startKoin { … }, the SDK detects the running Koin instance and attaches its modules to it rather than starting a second context. You must call SceytChatUIKit.initialize() after your own startKoin block so that the detection works correctly:
class MyApplication : Application() {

    override fun onCreate() {
        super.onCreate()

        // Start your own Koin context first
        startKoin {
            androidContext(this@MyApplication)
            modules(appModule, networkModule)
        }

        // Then initialize the UIKit — it will join the existing Koin context
        SceytChatUIKit.initialize(
            appContext   = applicationContext,
            apiUrl       = "wss://your-app-id.sceyt.com",
            appId        = "your-app-id",
            clientId     = getOrCreateClientId()
        )
    }
}
If you call SceytChatUIKit.initialize() before startKoin, the SDK starts its own standalone Koin application. Any Koin modules you register afterward will be in a separate context and will not be able to inject UIKit dependencies, and vice versa.

Disabling the local database

Setting enableDatabase = false instructs the SDK to skip creating the Room database entirely. All data is kept only in memory during the session.
SceytChatUIKit.initialize(
    appContext     = applicationContext,
    apiUrl         = "wss://your-app-id.sceyt.com",
    appId          = "your-app-id",
    clientId       = getOrCreateClientId(),
    enableDatabase = false   // no Room database, no disk persistence
)
Without the database, channel and message history is not available offline. The user will see an empty state until a live connection is established and data is fetched fresh from the server. Use this mode only when you deliberately want to avoid caching data on device — for example in a temporary guest session or an enterprise environment with strict data-residency requirements.

Sub-objects available after initialization

Once initialize() returns, the following top-level properties on SceytChatUIKit are safe to read and customize. The customizable sub-objects (theme, config, formatters, etc.) are lazily created on first access, so you can configure them at any point after initialize() completes. chatUIFacade is injected by Koin and is available as soon as the Koin context is started.
PropertyTypePurpose
chatUIFacadeSceytChatUIFacadeThe central facade for interactors, token-expiry flows, and session management (e.g. logOut). Injected by Koin after initialize().
themeSceytChatUIKitThemeColors, typography, and drawable overrides applied across all built-in screens and components.
configSceytChatUIKitConfigBehavioral settings such as query page sizes, message edit timeout, reaction limits, and channel ordering.
formattersSceytChatUIKitFormattersReplaces the default string formatters for dates, user names, file sizes, and other display text.
providersSceytChatUIKitProvidersVisual providers that resolve drawables and colors — for example, message-type icons, attachment icons, and presence-state colors.
renderersSceytChatUIKitRenderersCustom view renderers for message list items; swap in your own View subclasses for specific message types.
notificationsSceytNotificationsConfiguration and handlers for push notification appearance and behavior.
navigatorSceytChatUIKitNavigatorControls how the SDK navigates between its built-in screens; replace with your own implementation to integrate custom back-stacks or navigation components.
chatTokenProviderChatTokenProvider?Optional functional interface that the SDK calls automatically when a token expires. Set this for hands-free token refresh.
messageTransformerMessageTransformer?Intercepts outgoing and incoming Message objects so you can mutate them — for example, to apply end-to-end encryption or content moderation.
// Example: customize a few sub-objects right after initialization
SceytChatUIKit.initialize(appContext, apiUrl, appId, clientId)

SceytChatUIKit.config.messageEditTimeout      = 30 * 60 * 1000L  // 30 minutes
SceytChatUIKit.config.defaultReactions        = listOf("👍", "❤️", "😂", "😮", "😢", "🙏")
SceytChatUIKit.chatTokenProvider              = MyTokenProvider()
The customizable sub-objects (theme, config, formatters, providers, renderers, notifications, navigator) are lazyVar properties — they resolve on first access. chatUIFacade is Koin-injected and chatTokenProvider/messageTransformer are plain nullable vars. Regardless of the property type, always call initialize() before accessing any of them, because the Koin context and Room database must be set up first.

Build docs developers (and LLMs) love