---
updatedAt: 2026-02-25T12:53:46.000Z
---

# Migrate from Chat 1.0

Learn how to migrate to the Kustomer Chat 2.0 Android SDK from Chat 1.0.

This guide explains the key changes your team needs to make to migrate to the Kustomer Chat 2.0 (and later) Android SDKs from earlier SDK versions.

We've listed the Android SDK API calls you'll need to update for the migration below. Each entry provides brief descriptions and examples of the changes.

## Initialize and open chat

To learn more, see [Installation](https://developer.kustomer.com/chat-sdk/docs/installation) and [Open the Chat UI](https://developer.kustomer.com/chat-sdk/docs/open-chat-ui).

### From Chat 1.0

[block:code]
{
  "codes": [
    {
      "code": "// Initialize the Kustomer Android SDK with an API key, and start a user session.\nKustomer.init(this, K_KUSTOMER_API_KEY);\n\n// Present new or recent chat conversation if there is any.\nKustomer.showSupport(ACTIVITY);",
      "language": "java",
      "name": "Chat 1.0 Java code sample: initialize and open chat"
    }
  ]
}
[/block]

### To Chat 2.0

[block:code]
{
  "codes": [
    {
      "code": "// Init will throw AssertionException if the API Key used is invalid or has more than the required permissions\nKustomer.init(application = this, apiKey = apiKey) {\n  \t\t\t\t\t//Callback block\n            Log.i(TAG,\"Kustomer is initialized ${it.dataOrNull}\")\n        }\n\nKustomer.getInstance().open()",
      "language": "kotlin",
      "name": "Chat 2.0 Kotlin code sample: initiatlize and open chat"
    }
  ]
}
[/block]

## Override chat settings within the SDK

To learn more, see [Initialize Chat Android SDK with options
](https://developer.kustomer.com/chat-sdk/docs/installation#initialize-chat-android-sdk-with-options).

### From Chat 1.0

[block:code]
{
  "codes": [
    {
      "code": "KUSChatAttributes chatAttributes = new KUSChatAttributes();\n\n    // Initial message to start a new conversation\n    // if not specified then it will show either the most recent session or new window to start a new conversation\n    chatAttributes.put(Kustomer.KUS_MESSAGE,\"MESSAGE\");\n\n    // Custom schedule id, if not specified then SDK will use the schedule id specified on the admin panel\n    // This can be access by an admin panel via Administration > Business Schedules\n    chatAttributes.put(Kustomer.KUS_SCHEDULE_ID,\"SCHEDULE_ID\");\n\n    // Custom form id, if not specified then SDK will use the conversational assistant form specified on the admin panel\n    // This can be access be an admin panel via Channels > Chat > Conversational Assistant\n    chatAttributes.put(Kustomer.KUS_FORM_ID,\"FORM_ID\");\n\n    // Attach custom attributes to the user's next new conversation\n    // These key-value pairs must be enabled on the Conversation Klass via the admin portal.\n    // This can be done by an admin via Settings > Platform Settings > Klasses > Conversation\n    JSONObject customObject = new JSONObject();\n    customObject.put(\"customAttributeStr\", \"value\");\n\n    chatAttributes.put(Kustomer.KUS_CUSTOM_ATTRIBUTES, customObject);\n\n    // Option to provide latest emoji support to older devices\n    // if not specified then SDK will provide support by default.\n    // You can choose to disable it by providing false as the value\n    chatAttributes.put(Kustomer.KUS_EMOJI_COMPACT_SUPPORTED,true|false);\n\n// Present new chat conversation with chatAttributes a.k.a Key-Pair value options -\nKustomer.showSupport(ACTIVITY,chatAttributes);\n\n\n/*\n Show/Hide the \"New Conversation\" button in closed chat. By default, \"Start New Conversation\" button will appear in closed chat listing. You can update the settings by this method.\n*/\nKustomer.hideNewConversationButtonInClosedChat(true);",
      "language": "java",
      "name": "Chat 1.0 Java code sample: override chat settings within the SDK"
    }
  ]
}
[/block]

### To Chat 2.0

[block:code]
{
  "codes": [
    {
      "code": "val options = KustomerOptions.Builder()  \n            .setChatAssistantId(\"CUSTOM_ASSISTANT_ID\")\n            .setBusinessScheduleId(\"CUSTOM_BUSINESS_SCHEDULE\")\n            .setKnowledgeBaseId(\"CUSTOM_KB_ID\")\n            .setUserLocale(Locale)\n            .hideNewConversationButtonInClosedChat(true | false)\n            .setLogLevel(KusLogOptions.KusLogOptionErrors)\n                    \n  \n//Pass KustomerOptions in `init`\nKustomer.init(application = this, apiKey = apiKey, options = options.build()) {\n            Log.i(TAG,\"Kustomer is initialized ${it.dataOrNull}\")\n        }",
      "language": "kotlin",
      "name": "Chat 2.0 Kotlin code sample: override chat settings within the SDK"
    }
  ]
}
[/block]

* Use [Override Business Schedule id](https://developer.kustomer.com/chat-sdk/docs/override-business-schedule-id) to set the schedule id after Kustomer.init().

* To start a new conversation with an initial message use the following:

`Kustomer.getInstance().openNewConversation(message: "Custom Message"){}`

## Identify a customer

To learn more, see [Authentication](https://developer.kustomer.com/chat-sdk/docs/authentication).

### From Chat 1.0

[block:code]
{
  "codes": [
    {
      "code": "// Securely identify a customer. Requires a valid JSON Web Token.\nKustomer.identify(\"SECURE_ID_HASH\", new KUSIdentifyListener() {\n  @Override\n  public void onComplete(final boolean success) {\n      // Note: This will be called on background thread\n  }\n});",
      "language": "java",
      "name": "Chat 1.0 Java code sample: indentify a customer"
    }
  ]
}
[/block]

### To Chat 2.0

[block:code]
{
  "codes": [
    {
      "code": "// This is a suspend function\nsuspend Kustomer.getInstance().logIn(jwt) : KusResult<KusIdentifiedCustomer>\n\n// or\n\nKustomer.getInstance().logIn(jwt){\n            when (it) {\n                is KusResult.Success -> it.data\n                is KusResult.Error -> it.exception.localizedMessage\n            }\n        }",
      "language": "kotlin",
      "name": "Chat 2.0 Kotlin code sample: identify a customer"
    }
  ]
}
[/block]

## Log out a customer

To learn more, see [Log out](https://developer.kustomer.com/chat-sdk/docs/logout).

### From Chat 1.0

[block:code]
{
  "codes": [
    {
      "code": "// Resets the user session, clearing the user's access to any existing chats from the device.\nKustomer.resetTracking();",
      "language": "java",
      "name": "Chat 1.0 Java code sample: log out"
    }
  ]
}
[/block]

### To Chat 2.0

[block:code]
{
  "codes": [
    {
      "code": "Kustomer.getInstance().logOut()",
      "language": "kotlin",
      "name": "Chat 2.0 Kotlin code sample: log out"
    }
  ]
}
[/block]

## Describe a customer

To learn more, see [Describe Customer](https://developer.kustomer.com/chat-sdk/docs/describe-customer).

### From Chat 1.0

[block:code]
{
  "codes": [
    {
      "code": "/*\n Attach custom attributes to the user\n\n NOTE:\n Attached key-value pairs via the `custom` property must be enabled on the Customer Klass via the admin portal.\n This can be done by an admin via Settings > Platform Settings > Klasses > Customer\n*/\n\nKUSCustomerDescription customerDescription = new KUSCustomerDescription();\ncustomerDescription.setEmail(\"address@example.com\");\n\nJSONObject customObject = new JSONObject();\ncustomObject.put(\"customAttributeStr\", \"value\");\n// ...\n\ncustomerDescription.setCustom(customObject);\nKustomer.describeCustomer(customerDescription);",
      "language": "java",
      "name": "Chat 1.0 Java sample: describe a customer"
    }
  ]
}
[/block]

### To Chat 2.0

[block:code]
{
  "codes": [
    {
      "code": "val attributes = KusCustomerDescribeAttributes(\n  \n  emails = listOf(KusEmail(value)),\n  socials = listOf(KusSocial(value, KusSocialType.twitter))\n  custom = mutableMapOf(key to value)\n  \n)\n\nval result = Kustomer.getInstance().describeCustomer(attributes)\n  \n  when (result) {\n    is KusResult.Success -> //Success\n    is KusResult.Error -> //Error\n  }",
      "language": "kotlin",
      "name": "Chat 2.0 Kotlin sample: describe a customer"
    }
  ]
}
[/block]

## Describe a conversation

To learn more, see [Describe Conversation](https://developer.kustomer.com/chat-sdk/docs/describe-conversation).

### From Chat 1.0

[block:code]
{
  "codes": [
    {
      "code": "/*\n Attach custom attributes to the user's most recent conversation (or the first one they create)\n\n NOTE:\n These key-value pairs must be enabled on the Conversation Klass via the admin portal.\n This can be done by an admin via Settings > Platform Settings > Klasses > Conversation\n*/\n\nJSONObject conversationObject = new JSONObject();\nconversationObject.put(\"customAttributeStr\", \"value\");\n// ...\n\nKustomer.describeConversation(conversationObject);\n",
      "language": "java",
      "name": "Chat 1.0 Java sample: describe a conversation"
    }
  ]
}
[/block]

### To Chat 2.0

[block:code]
{
  "codes": [
    {
      "code": "val result = Kustomer.getInstance()\n                .describeConversation(conversationId, \n                                      mapOf(customKey to customValue))\n\n  when (result) {\n    is KusResult.Success -> //Success\n      is KusResult.Error -> //Error\n  }",
      "language": "kotlin",
      "name": "Chat 2.0 Kotlin sample: describe a conversation"
    }
  ]
}
[/block]

[block:callout]
{
  "type": "info",
  "body": "We have removed `Kustomer.describeNextConversation(conversationObject)` from the API. Instead, We recommend that you describe conversations in the callback block for one of the following:\n\n* `Kustomer.getInstance().openNewConversation{}`\n* `Kustomer.getInstance().openConversationWithId(conversationId){}`\n\nTo learn more, see [Open new conversation](https://developer.kustomer.com/chat-sdk/docs/open-new-conversation).",
  "title": "Deprecated: `Kustomer.describeNextConversation(conversationObject)`"
}
[/block]

## Count unread and open conversations

To learn more, see [Observe unread count](https://developer.kustomer.com/chat-sdk/docs/observe-unread-count) & [Observe active conversation ids](https://developer.kustomer.com/chat-sdk/docs/observe-active-conversation-ids).

### From Chat 1.0

[block:code]
{
  "codes": [
    {
      "code": "/*\n Return the current count of un-read messages. It might not be immediately available.\n*/\nKustomer.getUnreadMessageCount();\n\n/*\n Return the total number of open conversations.\n*/\nKustomer.getOpenConversationsCount();\n",
      "language": "java",
      "name": "Chat 1.0 Java code sample: count unread and open conversations"
    }
  ]
}
[/block]

### To Chat 2.0

[block:code]
{
  "codes": [
    {
      "code": "val unreadCount = liveData {\n        emitSource(Kustomer.getInstance().observeUnreadCount())\n}\n\nval activeConversationIds = liveData {\n        emitSource(Kustomer.getInstance().observeActiveConversationIds())\n}",
      "language": "kotlin",
      "name": "Chat 2.0 Kotlin code sample: count unread and open conversations"
    }
  ]
}
[/block]

## Is chat available?

To learn more, see [Is Chat available?](https://developer.kustomer.com/chat-sdk/docs/is-chat-available).

### From Chat 1.0

[block:code]
{
  "codes": [
    {
      "code": "/*\nCheck the \"turned on/off\" status of your chat along with within Business Hours and outside of Holidays settings asynchronously. For example if chat is turned off or outside of business hours, you may want to disable the button or deflect customers to contact an email)\n*/\nKustomer.isChatAvailable(new KUSChatAvailableListener(){\n    @Override\n    public void onSuccess(boolean enabled){\n        // Note: This will be called on background thread\n        \n        // This is called when API call is successful.\n        // enabled true represents chat is enabled in settings and within business hours and outside of holidays\n\n    }\n    \n    @Override\n    public void onFailure(){\n        // Note: This will be called on background thread\n        \n        // This is called when API call fails.\n    }\n});",
      "language": "java",
      "name": "Chat 1.0 Java code sample: Is chat available?"
    }
  ]
}
[/block]

### To Chat 2.0

[block:code]
{
  "codes": [
    {
      "code": "Kustomer.getInstance().isChatAvailable {\n            val response = it.successOr(KusChatAvailability.KUS_OFFLINE)\n            when(response){\n                KusChatAvailability.KUS_ONLINE -> //Chat is available\n                KusChatAvailability.KUS_OFFLINE -> //Chat is unavailable. outside of business hours, or a holiday\n                KusChatAvailability.KUS_HIDDEN -> //Chat is unavailable. outside of business hours, or a holiday\n                KusChatAvailability.KUS_DISABLED -> //Chat is disabled\n            }\n        }",
      "language": "kotlin",
      "name": "Chat 2.0 Kotlin code sample: Is chat available?"
    }
  ]
}
[/block]