PreChatValuesProvider

fun interface PreChatValuesProvider

Callback that supplies values for hidden pre-chat fields before a conversation starts.

Hidden pre-chat fields are configured in Salesforce Setup and are invisible to the end user. Use this provider to populate them programmatically (e.g., customer IDs, account numbers, or device metadata).

Register via CoreClient.registerHiddenPreChatValuesProvider.

Samples

coreClient.registerHiddenPreChatValuesProvider { fields ->
    fields.onEach { field ->
        field.userInput = when (field.name) {
            "CustomerId" -> "customer-123"
            "AccountNumber" -> "account-456"
            else -> ""
        }
    }
}

Functions

Link copied to clipboard
abstract suspend fun setValues(input: List<PreChatField>): List<PreChatField>

Populates hidden pre-chat fields with application-specific values.