Newer Version Available

This content describes an older version of this product. View Latest

Chat Visualforce Components Code Sample

Use this code sample to test and preview how Visualforce components can help you customize your chat windows.

The legacy chat product is scheduled for retirement on February 14, 2026, and is in maintenance mode until then. During this phase, you can continue to use chat, but we no longer recommend that you implement new chat channels. To avoid service interruptions to your customers, migrate to Messaging for In-App and Web before that date. Messaging offers many of the chat features that you love plus asynchronous conversations that can be picked back up at any time. Learn about chat retirement in Help.

Important

The following code sample shows a chat window that uses the following components:
  • liveAgent:clientChat
  • liveAgent:clientChatMessages
  • liveAgent:clientChatEndButton
  • liveAgent:clientChatLog
  • liveAgent:clientChatInput

For an active chat, this code results in the following chat window states:

Chat Waiting Chat window while chat is waiting to be accepted.
Chat in Progress Chat window during a chat.
Chat Ended Chat window when chat has ended.