Publish Your App as a Web Page
Deploy the Tencent Cloud ADP chatbot frontend on Vercel.
Tencent Cloud ADP Chatbot Frontend Deployment Guide
This project provides a third-party chatbot frontend for the Tencent Cloud Agent Development Platform (ADP).
It is built with React, offers real-time chat with the ADP backend, supports both WebSocket and SSE transport, and includes token management along with AI conversation capabilities.
🚀 Quick Deployment
One-click deploy on Vercel
Click below to clone and deploy instantly:
After setting environment variables (see below), press Deploy to go live.
Manual deployment to Vercel
- Push the project to your own GitHub repository.
- Log in to Vercel and import the repo.
- Configure environment variables in the project settings (details below).
- Click Deploy.
🔧 Environment variables
Set the following variables during deployment:
TENCENT_SECRET_ID
: Tencent Cloud API Secret IDTENCENT_SECRET_KEY
: Tencent Cloud API Secret KeyTENCENT_APP_ID
: Tencent Cloud App ID
How to obtain the values
:::info[Steps]
- Open API Key Management.
- Create a new key pair.
- Copy the Secret ID and Secret Key.
- Visit App Management and create an app.
- In Tencent Cloud ADP go to Application → Publish → API Management and copy the AppKey (App ID). :::
Add the variables in your Vercel project settings:
🌐 Embed on a website
Option 1: Inline iframe
Embed the deployed URL directly:
Adjust the size and styling as needed.
Option 2: Lightweight floating widget
Append the following script to any page to spawn a fixed widget in the lower-right corner:
Option 3: Single-line embed (recommended)
The repository includes an optimized embed.min.js
under public/
. After deployment you can integrate the widget with a single script tag. Highlights:
- 🎨 Matches the primary teal palette (#0d9488)
- ✨ Smooth 0.2s easing for open/close animations
- 🎯 Pixel-perfect 28×28 chat icon
- 🧹 Minimal UI with no redundant chrome
- 💾 Remembers open/minimized state via localStorage
Minimal usage
Full configuration example
Programmatic control
Custom styling
:::warning[Notes]
- The embed never exposes
TENCENT_SECRET_ID/KEY
; the iframe calls its own/getDemoToken
endpoint on the same origin for auth. - Allow your deployment domain to be framed by other sites (
X-Frame-Options
should not beDENY
). If CSP is enabled, permit the parent domain viaframe-ancestors
. - Strict CSP policies must list your deployment under
script-src
andframe-src
. - For advanced integrations, exchange messages via
postMessage
between the host page and the iframe. :::
🧪 Local development and testing
Prepare the environment
-
Install Node.js (LTS recommended).
-
Clone the project:
-
Install dependencies:
Configure environment variables
- Copy
.env.local.example
to.env.local
:
-
Populate the file:
Run the dev server
The app runs on http://localhost:9091
by default.
Build for production
The output is generated in the dist/
folder.
🔍 Troubleshooting
Common issues
-
Deployment fails
- Verify environment variables are present and accurate.
- Make sure the Tencent Cloud credentials have permission to access ADP services.
-
Chatbot does not respond
- Confirm
TENCENT_APP_ID
is correct. - Ensure the ADP application has been published.
- Confirm
-
Styling breaks after embedding
- Check that the host site allows iframes.
- Review CSP rules to confirm external resources are permitted.
Debug tips
- Inspect network requests in browser DevTools.
- Review console logs for runtime errors.
- Use Vercel deployment logs for additional clues.