Learn by doing? Try our interactive tutorial to build with Char in your browser.
Prefer automation? See Get Started with Claude Code for a two-command setup.
What you’ll build
By the end of this tutorial, you’ll have:- The Char agent embedded in your web application
- The agent running in development mode on localhost
Prerequisites
- A web application (React, Vue, Next.js, or any HTML project)
- npm, yarn, or pnpm
- Your app running on localhost
Step 1: Install the package
Step 2: Import the web component
In your application’s entry point, import the web component:App.tsx or layout.tsx. For Vue, in main.ts. For plain HTML, use a script tag instead (see Step 3).
Step 3: Add the agent to your page
Add the custom element where you want the agent to appear:Step 4: Verify
- Start your development server
- Open your app in the browser
- You should see a chat bubble in the bottom-right corner
- Click it and send a message
What you have now
- The agent is embedded and functional on localhost
- Users can chat with the agent
- The agent can see the page but can’t interact with it yet
What’s missing
To make the agent useful, you’ll need:- WebMCP tools — Let the agent fill forms, click buttons, read data
- Production authentication — Configure SSO for deployment
- Styling — Match the agent to your app’s theme

