Widgets
Famasi uses 3 interactive widgets for interactions where plain text doesnβt work. Widgets appear as embedded iframes inside ChatGPT and Claude.ai conversations.
Design principle
Widgets exist only where text genuinely cannot do the job. Everything else stays as LLM conversation β building a widget for every step would recreate the app and remove the reason to use the AI surface.
Pharmacy Selection
Triggered by: place_order response
What it shows:
- Price comparison across pharmacies
- Estimated delivery time (ETA) for each
- Pharmacy ratings
- Distance from the individual
Why a widget: Comparing price, ETA, and ratings across multiple pharmacies is not legible as plain text. A visual grid makes the decision faster.
Interaction: Individual clicks to select a pharmacy. Selection is sent back to the agent to complete the order.
Adapted from: DeliveryOptionsModal.tsx in the Famasi web app.
OTP Login
Triggered by: When authentication is required (before confirming an order)
What it shows:
- Phone number input field
- OTP code input field
- Submit button
Why a widget: Phone number input + OTP entry cannot be done reliably in text back-and-forth. A form with input validation is clearer and more secure.
Interaction: Individual enters phone number, receives SMS, enters OTP code, submits.
Note: This is a net-new widget β no equivalent exists in the web app since the web app uses standard form authentication.
Order Tracking
Triggered by: check_order_status response
What it shows:
- Status badge (Pending, Confirmed, Dispatched, Delivered)
- Delivery timeline with timestamps
- Pharmacy and order details
Why a widget: A status badge + timeline is clearer as a visual than a text description of each step.
Interaction: Read-only β individual views the current status. Updates appear when the page is refreshed or the tool is called again.
Adapted from: OrderTrackingPage.tsx in the Famasi web app.
Order Confirmation
Order confirmation does not use a custom widget. It uses MCP elicitation β the native yes/no prompt built into the MCP protocol. This keeps the confirmation simple and consistent across all platforms.
Technical details
Build system: Widgets are built with Vite + React + viteSingleFile plugin. Each widget compiles to a single self-contained HTML file with all JS and CSS inlined (no external dependencies at runtime). Output: 3 HTML files, embeddable as iframes.
Source location: Widget source lives in apps/widgets/ in the provider-guide-docs repo.
Embedding: MCP-compatible apps (ChatGPT, Claude.ai) render widgets as iframes in the conversation. The widget communicates with the host via window.openai bridge (ChatGPT) or postMessage (Claude.ai).
Terminal clients: Claude Code and Codex use text-based alternatives since they donβt support iframes.