Manta Developers
GitHub
Menu

Open a plan

Handle a plan the user opens from the chat.

What it is

onSelectPlan is an optional callback on embedded chat. The agent can propose an action plan. When the user opens that plan from the chat, this callback receives its IRI so your app can show it.

Import

import { EmbeddedChat } from "@manta-eu/react/components/embedded-chat";

Example

<EmbeddedChat
  user={{ id: "…", email: "you@example.com", name: "You" }}
  isOperator={false}
  onSelectPlan={(planIri) => {
    openPlan(planIri);
  }}
/>

Request

onSelectPlan?: (planIri: string) => void

planIri is the plan’s IRI. The callback returns void.

Response

The user sees a plan card in the transcript, with the plan name and its status. Choosing it calls onSelectPlan with that plan’s IRI string, and the chat stays on the conversation.

Leave the prop off, and the same choice opens the plan in the chat’s own plan view.