Verified 2026-07-14 against
@aomi-labs/react 0.5.0 and a live App on https://api.aomi.dev. Package versions move: trust the registry and your install over any version written here.You do not need a frontend to use or demo your App. Once it is active it already appears in the agent picker on
chat.aomi.dev. Build this when you want your own branded URL.Before you start
-
An App that is deployed and activated. See Deploy and activate on aomi CLI. Confirm it is live:
You want
active=true,artifact_ready=true, andloadedon your App. Ifartifact_readyis false, redeploy before you build a frontend against it. -
Node 20 or newer, and a package manager (
pnpmornpm). - A Vercel account.
Step 1: Create a Next.js app
Skip this if you already have one.Step 2: Add the AomiFrame widget
AomiFrame is the whole chat experience in one component: thread list, control bar, message composer, and the runtime wiring. It also handles sign in, so people who visit your page authenticate the same way they do on chat.aomi.dev.
This pulls a large dependency tree, including the wallet stack. On a slow connection it takes a few minutes.
Step 3: Point it at the backend
Create.env.local:
AomiFrame resolves the backend in this order: the backendUrl prop, then NEXT_PUBLIC_BACKEND_URL, then http://localhost:8080.
Passing the prop explicitly is the most predictable choice, because it works even if an environment variable is missing on your host.
Step 4: Render the widget
Replace the contents ofapp/page.tsx:
AomiFrame takes width, height, className, style, walletPosition, and backendUrl.
If your App only reads data and simulates, and never asks anyone to sign a transaction, hide the wallet controls:
Step 5: Run it locally
http://localhost:3000, pick your App in the picker, and send it a message. Confirm you get a real answer back before you deploy. Then check the production build:
Step 6: Deploy to Vercel
./ as the directory, and do not override the build settings. Next.js is detected automatically.
Then ship it:
NEXT_PUBLIC_BACKEND_URL instead of the backendUrl prop, add it in the Vercel dashboard under Settings, Environment Variables, then redeploy so the production build picks it up. If you passed the prop, there is nothing to configure.
Show only your App
By default the widget shows the full Aomi chat, so a visitor can switch to any App. To keep your page focused on one App, wrap the widget in the runtime provider and filter:AomiRuntimeProvider accepts backendUrl, applicationId, appPlatforms, and clientOptions. Use applicationId when you want one specific App, and appPlatforms to narrow the list to a platform.
Calling your App from your own backend
The widget is the supported way to put a chat on a page, because it carries sign in with it. If instead you want to call your App from a service you control, create an app key:- Go to
chat.aomi.dev/settingsand open App Keys. - Give the key a label, select the Apps it may access, and create it.
- Copy the key. It is shown only once.
AOMI-APP-KEY header to /api/thread/chat.
Troubleshooting
Next
Deploy and activate on aomi CLI
Ship the App itself, then come back and give it a frontend.
The builder toolchain
The full reference for
aomi-build and aomi-run.Common errors
The errors you are most likely to hit, each with its fix.
Add the chat widget
More ways to embed and customize the widget.