> ## Documentation Index
> Fetch the complete documentation index at: https://www.text.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Show customer data inside the agent view

> Pass session variables or persistent customer properties to agents so they see relevant context without switching tools.

**APIs involved:** [Chat Widget JS API](/docs/api/chat-widget-js-api/), [Configuration API](/docs/api/configuration/), [Customer Data Platform API](/docs/api/customer-data-platform/)

Suppose a customer starts a chat and you want your support agents to see their subscription plan, recent order history, or account tier without switching tools. There are two ways to get that data in front of agents, and they serve different purposes.

<Tabs>
  <Tab title="Session variables">
    The lightweight path. The Chat Widget JS API's [`set_session_variables`](/docs/api/chat-widget-js-api/methods#set-session-variables) call attaches arbitrary key-value pairs to a chat before it starts. When a customer opens the widget, your page calls:

    ```js theme={null}
    LiveChatWidget.call("set_session_variables", {
      plan: "enterprise",
      last_order_id: "ORD-8821",
      account_since: "2021-03-15"
    });
    ```

    Those values appear in the agent's view under the customer details panel. They're visible during the chat but not stored in Text's customer records.

    Use this when the data is contextual and changes per visit.
  </Tab>

  <Tab title="Customer Data Platform">
    For persistent, queryable data. You push customer properties into Text — loyalty tier, account value, product line — and they appear in the customer's profile for every chat, not just the current session.

    Properties are defined via the [Configuration API](/docs/api/configuration/) (register a namespace and schema), then written via the [Customer Data Platform API](/docs/api/customer-data-platform/). Agents see them alongside the customer's chat history.

    Use this when the data should follow the customer across every conversation.
  </Tab>
</Tabs>
