---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Pass NowChatConfiguration to modify the behavior of NowChat

# Pass NowChatConfiguration to modify the behavior of NowChat {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

You can pass an optional NowChatConfiguration parameter when starting a chat session to modify some of the behavior of NowChat.
The NowChatConfiguration object contains the following options:

* closePrompt: Prompt text that appears before exiting a chat window. You define this prompt text through the following parameters:
  * header: Nullable string value that appears on the prompt's header.
  * message: String value that appears on the prompt's main body.
  * acceptButtonTitle: String value that appears on the primary button of the prompt. This button closes the chat window.
  * declineButtonTitle: String value that appears on the secondary button of the prompt. This button dismisses the prompt without closing the chat window.
* disabledFeatures: List of NowChat features to disable. Refer to the NowChatConfiguration.Feature enum class for the list of features that you can disable.
* conversationOptions: List of conversation options to apply to NowChat. Refer to the NowChatConvestation.ConversationOption enum class for the list of options that you can apply.
* uiConfiguration: UIConfiguration value used to configure UI components in NowChat.
{#mobsdk-and-chat_options__ul_v4q_lyj_kbc}

The following code example shows how to use NowChatConfiguration() to configure NowChat.

    class MainActivity : AppCompatActivity() {
      @Inject

      lateinit var sdkManager: SdkManager
     
      override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
     
        //Drawable to use instead of the default NowChat back button.
        val myDrawable = ContextCompat.getDrawable(activity, R.drawable.my_drawable)
     
        val nowChatConfiguration = NowChatConfiguration(
          closePrompt = NowChatConfiguration.ClosePrompt(
            header = null,
            message = "Are you sure you want to leave?",
            acceptButtonTitle = "Yes",
            declineButtonTitle = "No"
          ),
          disabledFeatures = listOf(NowChatConfiguration.Feature.START_NEW_CONVERSATION), 
          conversationOptions = listOf(NowChatConfiguration.ConversationOption.FORCE_NEW_CONVERSATION), 
          uiConfiguration = NowChatConfiguration.UIConfiguration( 
            closeButton =  NowChatConfiguration.CloseButton( 
              icon = myDrawable
            ),
            attachmentUploadButton = NowChatConfiguration.AttachmentUploadButton(isVisible = false)
          )
        )
     
        //Start NowChat 
        lifecycleScope.launch { 
          sdkManager.getNowChatService()?.start(this@MainActivity, nowChatConfiguration = nowChatConfiguration) 
        }
      }
    } 

For additional information, see [NowChatConfiguration - Android](https://servicenow-prod.fluidtopics.net/M7o6dYMD~jFjeFbRCDfAyA#NowChatOptionsAndroid "The NowChatConfiguration class enables you to configure options on a chat session, such as showing a prompt before closing a chat window, disabling features while using chat, applying different conversation options when using chat, and configuring UI components in NowChat.") and [NowChatService - start(activity: Activity, themeColors: NowChatTheme = object: NowChatTheme{}, contextData: Map\<String, Any\> = mapOf(), chatConfiguration: NowChatConfiguration? = null)](https://servicenow-prod.fluidtopics.net/Q3l5E6Rkr2057VkSlu6ktQ#NChatServA-start_O_O "Launches the specified NowChat activity.").

