AomiWidget to add application-bound chat, wallet authentication, and transaction approval to your React app. Your frontend selects the App and sign-in method, and the connected wallet handles requests the user approves.
Prerequisites
Before you start, you need:- An activated Aomi App and its numeric Application ID.
- An HTTPS origin for production, added to the selected wallet provider’s allowlist.
- React 18 or 19 running in the browser.
- A decision between browser-wallet, Para, or Privy authentication.
In Next.js, mount the widget from a client component. The widget uses browser wallet APIs and cannot render as a server-only component.
Install
File structure
The widget needs one client component and one environment file. It does not require a custom API route or transaction broadcaster.- Next.js
- Vite
Environment variables
- Next.js
- Vite
These names are conventions for your host application. Pass values to
apiUrl, applicationId, and the selected auth object. In current source, Para accepts auth.apiKey and Privy accepts auth.appId; do not rely on a published package reading your framework’s environment variables internally. Use process.env.NEXT_PUBLIC_* in Next.js or import.meta.env.VITE_* in Vite at the call site. These identifiers are public; provider secrets stay on your server.
Explicit provider props describe the current source contract. Check your installed widget release and provider allowlists before using the example. See package and API compatibility.
Choose authentication
Authentication establishes the user session. Wallet ownership establishes which address may approve transactions. Aomi verifies these separately.- Browser wallet
- Para
- Privy
Browser mode authenticates an existing EVM or Solana wallet. It does not require a Para or Privy provider import.
import.meta.env.VITE_AOMI_APPLICATION_ID and import.meta.env.VITE_AOMI_API_URL in the same component.
These examples intentionally include only public browser configuration.
Quickstart explains how the widget exchanges a
wallet or provider proof for an origin-bound access token. The current
AomiWidget executes supported action requests with the connected client
wallet; it does not enable account abstraction or sponsorship automatically.Verify the setup
- Open the page from the HTTPS origin configured with your wallet provider.
- Sign in and connect or create a wallet.
- Confirm the thread list and composer load without an App-key prompt.
- Send a message and confirm a response appears.
- Switch wallets or networks and confirm the widget updates the active owner.
- For a transaction-enabled App, confirm the approval dialog shows the request, owner, and network before signing.