Brand Concierge API reference (Android)

Managed Integration

The SDK manages the chat lifecycle. Provide a trigger UI element — the SDK shows it when the extension is ready and opens the chat as a full-screen dialog when the trigger is invoked.

Jetpack Compose

Syntax

@Composable
fun ConciergeChat(
    modifier: Modifier = Modifier,
    viewModel: ConciergeChatViewModel,
    surfaces: List<String>? = null,
    handleLink: LinkHandler? = null,
    content: @Composable (showChat: () -> Unit) -> Unit
)

Parameters

Example

@Composable
fun MyScreen() {
    val viewModel = viewModel<ConciergeChatViewModel>()

    ConciergeChat(
        viewModel = viewModel,
        surfaces = listOf("web://example.com/your-surface.html")
    ) { showChat ->
        MyTriggerButton(onClick = { showChat() })
    }
}

XML/Views

Syntax

fun bind(
    lifecycleOwner: LifecycleOwner,
    viewModelStoreOwner: ViewModelStoreOwner,
    surfaces: List<String>? = null,
    theme: ConciergeThemeData? = null,
    handleLink: ((String) -> Boolean)? = null,
    triggerView: View
)

Parameters

Example

val chatView = findViewById<ConciergeChatView>(R.id.concierge_chat)
val triggerButton = Button(this).apply { text = "Chat" }

chatView.bind(
    lifecycleOwner = this,
    viewModelStoreOwner = this,
    surfaces = listOf("web://example.com/your-surface.html"),
    triggerView = triggerButton
)

Custom Integration

Embed the chat interface directly into your screen and manage its lifecycle yourself. Use this for dedicated chat screens or custom layouts where you control when chat appears and handle dismissal.

Jetpack Compose

Syntax

@Composable
fun ConciergeChat(
    viewModel: ConciergeChatViewModel,
    onClose: () -> Unit,
    modifier: Modifier = Modifier,
    handleLink: LinkHandler? = null
)

Parameters

Example

@Composable
fun YourChatScreen() {
    val viewModel = viewModel<ConciergeChatViewModel>()
    val conciergeState by ConciergeStateRepository.instance.state.collectAsStateWithLifecycle()
    val surfaces = listOf("web://example.com/your-surface.html")

    ConciergeStateRepository.instance.setSessionSurfaces(surfaces)

    val ready = conciergeState.configurationReady &&
        conciergeState.experienceCloudId != null &&
        conciergeState.surfaces.isNotEmpty()

    if (ready) {
        ConciergeChat(
            viewModel = viewModel,
            onClose = { /* navigate back */ }
        )
    }
}

XML/Views

Syntax

fun bind(
    lifecycleOwner: LifecycleOwner,
    viewModelStoreOwner: ViewModelStoreOwner,
    surfaces: List<String>? = null,
    theme: ConciergeThemeData? = null,
    handleLink: ((String) -> Boolean)? = null,
    onClose: () -> Unit
)

Parameters

Example

val chatView = findViewById<ConciergeChatView>(R.id.concierge_chat)

chatView.bind(
    lifecycleOwner = this,
    viewModelStoreOwner = this,
    surfaces = listOf("web://example.com/your-surface.html"),
    onClose = { finish() }
)

Concierge.setAuthTokenProvider

Registers a ConciergeAuthTokenProvider that supplies an app-minted authentication token, attached to every chat and feedback request until cleared. Pass null to clear a previously registered provider.

Syntax

@JvmStatic
@JvmOverloads
fun setAuthTokenProvider(
    provider: ConciergeAuthTokenProvider?,
    timeoutMillis: Long = 3000L
)

Parameters

Example

Concierge.setAuthTokenProvider(
    ConciergeAuthTokenProvider { myAuthTokenCache.getCurrentToken() },
    timeoutMillis = 5000L
)

ConciergeAuthTokenProvider

A functional interface that supplies the app-minted authentication token attached to each conversation turn (chat and feedback). Register an implementation with Concierge.setAuthTokenProvider.

Syntax

fun interface ConciergeAuthTokenProvider {
    fun provideToken(): String?
}

Parameters

ConciergeThemeLoader.load

Loads a ConciergeThemeData from a JSON file in the app's assets directory. Returns null if the file cannot be found or parsed.

Syntax

@JvmStatic fun load(context: Context, filename: String): ConciergeThemeData?

Parameters

Example

val theme = ConciergeThemeLoader.load(context, "my-theme.json")
    ?: ConciergeThemeLoader.default()

ConciergeThemeLoader.default

Returns the built-in default ConciergeThemeData.

Syntax

@JvmStatic fun default(): ConciergeThemeData

Example

val theme = ConciergeThemeLoader.default()