> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chat.md).

# Chat

Build a Chat conversation on a Salesforce Case page, then save replies and pins or refresh the conversation when a message changes in another session.

Use these tutorials to build a conversation on a Lightning Case page. Start with standard Case Comments, then choose a guide for the behavior your team needs.

## Start with case comments

Build a thread that shows and saves comments for the open case.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Save Case Comments from Chat</strong></td><td>Add an Avonni Chat to a Salesforce Case page, display the current case's internal comments, and let support agents save new comments from the thread.</td><td><a href="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FXNxk2pNaCe3vSEixgQvS%2Fchat-cover-save-case-comments.jpg?alt=media">chat-cover-save-case-comments.jpg</a></td><td><a href="https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chat/save-case-comments.md">Save Case Comments from Chat</a></td></tr></tbody></table>

## Extend a team conversation

Use a custom message object for saved replies and pins. Add event-driven refresh when several agents work the same case.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Keep replies and pins after reload</strong></td><td>Keep a workaround at the top of an escalation chat and save quoted replies with Avonni Chat, so both are still visible when another agent opens the case.</td><td><a href="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FDeLUvb185FSgJ4GZTgJF%2Fchat-cover-persist-replies-and-pins.jpg?alt=media">chat-cover-persist-replies-and-pins.jpg</a></td><td><a href="https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chat/persist-replies-and-pins.md">Keep replies and pins after reload</a></td></tr><tr><td><strong>Refresh Chat across sessions</strong></td><td>Refresh a case conversation in another agent's open Lightning session when Salesforce publishes a Platform Event for the same case.</td><td><a href="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2Ffg0SotuXLXQCMtWL0HjK%2Fchat-cover-refresh-chat-across-sessions.jpg?alt=media">chat-cover-refresh-chat-across-sessions.jpg</a></td><td><a href="https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chat/refresh-chat-across-sessions.md">Refresh Chat across sessions</a></td></tr></tbody></table>

See the [Chat component reference](https://docs.avonnicomponents.com/dynamic-components/components/chat.md) for message mappings, publisher settings and available interactions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/dynamic-components/tutorials/components/chat.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
