Hosted Quick Start
Build a working ggui integration against hosted Guuey in under 5 minutes. Your agent will push a feedback form to a user, wait for their response, and process the submitted data.
Your Agent β hosted Guuey β Generated Form UI β User fills it β Agent gets the dataPrerequisites
Section titled βPrerequisitesβ- Node.js 18+
- A Guuey account at platform.guuey.com (hosted path only β the OSS
ggui servepath needs no account)
Step 1: Create an App and Get Your API Key
Section titled βStep 1: Create an App and Get Your API Keyβ- Go to platform.guuey.com/apps and sign in
- Click βNew Appβ (or go to
/apps/new) and give it a name (e.g., βMy First Agentβ) - Submit the form. An API-key dialog opens immediately with both your App ID and API key (starts with
ggui_sk_) - Click Copy to copy the API key, then save the App ID shown next to it β youβll need both
Keep your API key secret. Never commit it to source control. The key is shown once β if you lose it, you can rotate to a new one from Workspace Settings β API Keys.
Step 2: Install the SDK
Section titled βStep 2: Install the SDKβnpm install @ggui-ai/mcp-clientOr with other package managers:
pnpm add @ggui-ai/mcp-clientyarn add @ggui-ai/mcp-clientStep 3: Write Your Agent
Section titled βStep 3: Write Your AgentβCreate a file called agent.ts:
import { GguiClient } from "@ggui-ai/mcp-client";
// Initialize the clientconst ggui = new GguiClient({ apiKey: process.env.GGUI_API_KEY!, appId: process.env.GGUI_APP_ID!,});
async function main() { // 1. Push a UI β ggui generates a feedback form console.log("Generating feedback form..."); const { sessionId, url } = await ggui.push({ story: { intent: "Collect product feedback", prompt: "Show a feedback form with a 1-5 star rating and a comments text area", }, });
console.log(`Share this URL with your user: ${url}`);
// 2. Wait for the user to submit console.log("Waiting for user to submit..."); const events = await ggui.waitForCompletion(sessionId, { pollInterval: 2000, // Check every 2 seconds maxWait: 300_000, // Give up after 5 minutes });
// 3. Process the response const submitEvent = events.find((e) => e.type === "data:submit"); if (submitEvent) { // `data:submit` envelopes carry `{ action, data, tool? }`. `action` // matches the action id from the UI's contract (e.g. "submit"); the // form fields you want are on `data`. console.log("User submitted:", submitEvent.payload.data); } else { console.log("No submission received (user may have timed out)"); }
// 4. Clean up await ggui.close(sessionId); console.log("Done!");}
main().catch(console.error);Step 4: Run It
Section titled βStep 4: Run ItβSet your environment variables and run:
export GGUI_API_KEY="ggui_sk_..."export GGUI_APP_ID="app_..."npx tsx agent.tsYouβll see output like:
Generating feedback form...Share this URL with your user: https://render.guuey.com/abc123Waiting for user to submit...Open the URL in your browser β youβll see a generated feedback form. Fill it out and submit. Back in your terminal:
User submitted: { rating: 4, comments: "Works great!" }Done!Step 5: Embed in React (Optional)
Section titled βStep 5: Embed in React (Optional)βWant to render the ggui UI inside your own React app instead of using the render URL? Install the React SDK:
npm install @ggui-ai/reactWrap your app in GguiProvider and use GguiSession:
import { GguiProvider, GguiSession, StackItemRenderer } from "@ggui-ai/react";
function App({ sessionId, stackItem }) { return ( <GguiProvider appId="app_..." wsEndpoint="wss://ws.guuey.com"> <GguiSession sessionId={sessionId} onInteraction={(envelope) => { // `envelope` is the canonical `ActionEnvelope` // (`{ sessionId, type: 'interaction:*', payload, ... }`). console.log("User interaction:", envelope); }} onError={(error) => console.error("Session error:", error)} > {({ connectionStatus }) => ( <div> {connectionStatus !== "connected" && <p>Connecting...</p>} <StackItemRenderer stackItem={stackItem} /> </div> )} </GguiSession> </GguiProvider> );}The generated UI renders live inside your app, with real-time updates as the user interacts.
What Just Happened?
Section titled βWhat Just Happened?β- Your agent called
ggui.push()with a natural language prompt - gguiβs UI Builder generated a React component from the prompt (using AI)
- The render URL served the generated UI to the userβs browser
- The user filled out the form and submitted it
- Your agent polled
ggui.consume()(viawaitForCompletion()) and received the submission data
Agent ggui Browser β β β βββ push("feedback form") ββ β β βββ generate UI βββ compile β ββ { sessionId, url } βββββ β β β β β ββββ user opens URL βββββββββ β βββββ rendered form βββββββββ β β β βββ consume(sessionId) ββββ β β ββββ data:submit βββββββββββ ββ { events } βββββββββββββ β β β β βββ close(sessionId) ββββββ βNext Steps
Section titled βNext Stepsβ- MCP Client SDK β Full API reference for the
GguiClientclass - React SDK β Embed ggui UIs in your React app
- Examples β See OpenClaw, Claude, OpenAI, and Gemini integrations
- Cookbook β Common patterns with code samples
- Troubleshooting β Common issues and solutions