Learn how to integrate APUS AI Service into your full-stack dApp
@apus/ai
library and manage your application’s core logic. The diagram below illustrates this common architecture.
npm
or yarn
installed on your system.
Arweave Wallet Kit
package:
This is the official library for connecting Arweave wallets to your dApp. You will need to install it in your project. We’ll cover the installation in the next section.
Arweave Wallet Kit
and aoconnect
that the AI will need.
permaweb-docs-2025-08-05.llms.txt
arweave-wallet-kit.llms.mdx
permaweb-docs-2025-08-05.llms.txt
file and arweave-wallet-kit.llms.mdx
to provide it with context. Then, copy and paste the following prompt exactly as it is:
The Magic Prompt:
Using the context from the providedpermaweb-docs
file and your knowledge of modern web development, create a single, complete React component namedWalletConnector.js
. This component must do the following:
- Use
@arweave-wallet-kit/react
to display a connect button in the header.- When the wallet is connected, it should display the user’s active wallet address.
- Create an example page include an input field where user can enter a text message and a “Send Message” button.
- When the “Send Message” button is clicked, it must use the
message
function from@permaweb/aoconnect
to send the text from the input field to the AO process with the IDYOUR_PROCESS_ID
.- The component should also display the returned message ID after the message is successfully sent.
Arweave Wallet Kit
and aoconnect
. We’ll build the same component as the AI-powered quick start, but step-by-step.
This guide follows the official Arweave Wallet Kit
documentation and best practices.
main.jsx
or index.js
) with the ArweaveWalletKit
provider.
WalletConnector.js
that will handle all wallet interactions and message sending.
Start with the basic structure for connecting the wallet and displaying its address.
aoconnect
’s request
function to POST
a message to your AO process’s push
endpoint.patch@1.0
device. Your frontend can then GET
these exposed states via a direct HTTP request.aos
process.
AIBox.js
to send messages using aoconnect.request
and poll the patch@1.0
Cache API for the result.
messageId
. It should then poll your backend process using this messageId
until the response is ready.
Here’s the simplified logic for your React component: