Loading...
Loading...
Add AI chat widget to your Next.js app
npx skill4agent add iblai/vibe iblai-chat<mentor-ai>
AI Assistant: Before running, you MUST ask the user for their agent/mentor ID (a UUID likeiblai add chat). This is required for the chat widget to connect to an AI agent.3f8a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5cIf the user does not have an agent ID, direct them to https://mentorai.iblai.app to create an AI agent. They can find the agent ID in the agent settings page.Once you have the ID, set it in:.env.localNEXT_PUBLIC_DEFAULT_AGENT_ID=<the-uuid-they-gave-you>Do NOT add custom styles, colors, or CSS overrides to the ChatWidget. It ships with its own styling. Keep the component as-is. Do NOT implement dark mode unless the user explicitly asks for it.When building custom UI around the chat widget, use the ibl.ai brand:
- Primary:
, Gradient:#0058cclinear-gradient(135deg, #00b0ef, #0058cc)- Button:
bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white- Font: System sans-serif stack, Style: shadcn/ui new-york variant
- Use shadcn components for custom UI -- they share the same Tailwind theme and render in ibl.ai brand colors automatically.
You MUST runbefore telling the user the work is ready./iblai-testAfter all work is complete, start a dev server () so the user can see the result at http://localhost:3000.pnpm devis NOT aiblai.envreplacement — it only holds the 3 shorthand variables (.env.local,DOMAIN,PLATFORM). Next.js still reads its runtime env vars fromTOKEN..env.localUseas the default package manager. Fall back topnpmif pnpm is not installed. The generated app should live in the current directory, not in a subdirectory.npm
/iblai-authiblaiiblai --version/iblai-authiblaiiblai --versionpip install --upgrade iblai-app-clinpm install -g @iblai/cli@latestiblai.envPLATFORMDOMAINTOKENiblai.envcurl -o iblai.env https://raw.githubusercontent.com/iblai/vibe/refs/heads/main/iblai.envAI Assistant: Once the user provides their agent ID, write it directly tousing the Edit tool — do NOT echo it back in shell commands. Add or update this line in.env.local:.env.localNEXT_PUBLIC_DEFAULT_AGENT_ID=<the-uuid>
iblai add chat| File | Purpose |
|---|---|
| |
axd_tokentenantuserDataauthrelyonhostimport { ChatWidget } from "@/components/iblai/chat-widget";
// Full viewport (recommended)
<ChatWidget mentorId={process.env.NEXT_PUBLIC_DEFAULT_AGENT_ID!} width="100vw" height="100vh" />
// Custom viewport-relative dimensions
<ChatWidget mentorId="..." width="80vw" height="90vh" />
// Or hardcode an agent ID (useful for multi-agent pages)
<ChatWidget mentorId="3f8a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c" width="100vw" height="100vh" />| Prop | Type | Default | Description |
|---|---|---|---|
| | (required) | Agent/mentor UUID -- ask the user for this |
| | from | Override tenant key (defaults to |
| | | Color theme |
| | | Widget width -- use |
| | | Widget height -- use |
/iblai-testpnpm buildpnpm testpnpm dev &
npx playwright screenshot http://localhost:3000 /tmp/home.png