Skip to main content
Want the terminal instead of a frontend? The Quickstart covers the aomi client CLI. This page covers installing and using the chat widget in a Next.js app.
Install and run the Aomi chat widget in a Next.js project with a single CLI command, then use the AomiFrame component API to shape it.

Prerequisites

  • Next.js 15 app with the App Router
  • Tailwind CSS configured
  • shadcn/ui initialized (npx shadcn init already run, components.json present)
Starting from scratch:

Install the widget

This installs the AomiFrame component, all sub-components, and every dependency in one step.

What gets installed

npm packages: Component files:

Registry architecture

Components are pulled from three registries, all resolved automatically by the CLI: Since components are copied into your project, you own the source code and can edit anything.

Set environment variables

Create .env.local:
For wallet support, add:

Add AomiFrame to a page

Configure your API key

Option A: via the ControlBar UI

The widget includes a ControlBar with an API key input. Click the key icon, paste your API key, and select your app from the dropdown. The key is stored in localStorage for subsequent visits.

Option B: programmatically

Set the API key and app in code using the useControl hook:

Run your app

Open http://localhost:3000. You should see the full chat interface with a thread sidebar, a message composer, a ControlBar, and streaming AI responses when you send a message.

Namespace configuration

For shorter install commands, add a registry namespace to components.json:
Then install with:

Updating components

Re-run the install with --overwrite to pull the latest versions:
Review changes before committing:

Component API

The rest of this page documents the AomiFrame component surface: props, the compound API for custom layouts, and ControlBar options.

Basic usage

Compound component API

Customize the layout using individual components:

AomiFrame props

Control bar

The ControlBar provides built-in controls for:
  • ModelSelect: switch AI models at runtime
  • AppSelect: switch between Aomi Apps
  • ApiKeyInput: enter scoped API keys
  • ConnectButton: connect a wallet
  • NetworkSelect: select blockchain network

Theming

Customize colors using shadcn CSS variables in your Tailwind configuration.

Next Steps

Last modified on June 4, 2026