A web-based chat interface for interacting with Salesforce Agent API.
Disclaimer: This is a test application designed to showcase the capabilities of the Salesforce AgentForce API. It demonstrates how to build a web interface that connects to the Salesforce Agent API.
- Dark theme with purple accents
- Chat interface with streaming responses
- Powered by Salesforce AgentForce API
The landing page features a modern, dark-themed UI with the Salesforce Agent logo. Users can start a chat session by clicking the "Start Chatting" button.
The chat interface provides a clean, intuitive experience with the agent's responses displayed in a conversation format. The UI includes a connection status indicator and a "New Chat" button in the header.
To access the Salesforce Agent API, you must set up a connected app that supports the client credential flow. Follow these steps:
- Create a connected app in your Salesforce org
- Configure the connected app to use the client credentials flow
- Obtain your client ID, client secret, and other required credentials
- Set up your environment variables as described below
For detailed instructions on setting up the Salesforce Agent API, please refer to the official documentation: Salesforce Agent API Getting Started Guide
- Node.js 18 or later
- npm or yarn
- Salesforce connected app credentials
- Clone the repository
- Install dependencies:
npm install
# or
yarn install- Set up your environment variables in
.env:
# Salesforce Agent API credentials
BOT_ID=your_bot_id
AFP_API_URL=your_afp_api_url
CORE_URL=your_core_url
CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret
- Run the development server:
npm run dev
# or
yarn dev- Open http://localhost:3000 in your browser.
The app uses a placeholder avatar by default. To customize it:
- Replace the
/public/profile.pngfile with your own image (keeping the same filename) - Or update the image path in
app/page.tsxto point to your custom image
If you prefer to use a text-based avatar instead of an image:
{/* Comment out or remove the Image component */}
{/* <Image
src="/profile.png"
alt="Profile"
fill
className="object-cover"
/> */}
{/* Use this text-based avatar instead */}
<div className="absolute inset-0 flex items-center justify-center bg-secondary text-secondary-foreground">
<span className="text-4xl font-bold">A</span> {/* Use your initial or icon */}
</div>You can customize the theme colors in app/globals.css. The current theme uses:
- Dark background with purple accents
- Primary color:
267 75% 60%(purple) - Accent color:
267 75% 40%(darker purple)
This application can be deployed on Vercel, Netlify, or any other platform that supports Next.js applications.
npm run build
# or
yarn buildThis project is licensed under the MIT License.

