---
title: End Chat
slug: web-view-sdk-end-chat
createdAt: 2026-11-03T10:14:15.735Z
---

End the conversation when the user is done with it, or when they sign out of your app

::::Tabs
:::Tab{title="iOS"}
```swift
Task {
    await KindlyWebViewSDK.endChat()
}
```
:::

:::Tab{title="Android"}
```kotlin
lifecycleScope.launch {
    KindlyWebViewSDK.endChat().await()
}
```

`endChat` returns a `Deferred`. Await it when the order of calls matters, or ignore it
:::

:::Tab{title="Flutter"}
```dart
await KindlyWebViewSDK.endChat();
```
:::

:::Tab{title="React Native"}
```typescript
await KindlyWebViewSDK.endChat();
```
:::
::::

The chat screen is dismissed, the conversation ends and the SDK stays started, so the next display starts a new conversation with a fresh greeting. With a chat page loaded, the SDK tells the Kindly backend that the user left. Without one, it deletes the stored conversation without telling the backend, and that session expires on its own. Before `start` the call does nothing

Ending the chat from inside the chat does the same. To stop the SDK as well, see [Kill SDK](docId\:dENUQuvDOyrpbKayCfLZb)

## Stored conversation

The chat keeps its conversation in your app's web view storage (the default WebKit website data store on iOS, the WebView storage on Android), as the web chat does in a browser, so it survives app restarts and continues on the next display. It is stored for the origin `chat.kindlycdn.com`, per bot and market, and includes the chat's session token and chat id. Any other web view in your app that loads `chat.kindlycdn.com` shares this storage

`endChat` and `kill` delete the conversation of the current bot and market, so call one of them when a user signs out of your app. The widget's browser id, `kindly-chat-browser-id`, belongs to no bot or market and stays
