AAI SDK
    Preparing search index...

    Function client

    • Define and mount a client UI for a voice agent.

      Tier 1 (config-only): Pass options without component to get the default shell (StartScreen + ChatView, optional sidebar).

      Tier 2 (custom component): Pass component to render a fully custom root component inside the providers. In this tier a provided name also sets document.title (there is no shell header to show it in).

      Mounts into target — a CSS selector or DOM element, defaulting to "#app" — and throws Element not found: <target> when the selector matches nothing.

      Parameters

      Returns ClientHandle

      A ClientHandle for cleanup.

      import { client } from "@alexkroman1/aai-ui";

      function OrderPanel() {
      return <div>Cart</div>;
      }

      client({
      name: "Pizza Ordering",
      theme: { bg: "#1a1a1a", primary: "#e55" },
      sidebar: OrderPanel,
      tools: { add_pizza: { icon: "🍕", label: "Adding pizza" } },
      });
      import { client, useSession } from "@alexkroman1/aai-ui";

      function MyCustomApp() {
      const session = useSession();
      return <div>{session.state}</div>;
      }

      client({ component: MyCustomApp });

      If the target element is not found in the DOM.