Deploying agent and AI Chat
Deploy AI chat in your frontend by embedding it as an iFrame.Deploying an Application (Recommended)
To embed an Application Space for a specific user, use the following iFrame:applicationId— found in your hub2 application settings, or in the URL when viewing the application:/projects/{projectId}/applications/{applicationId}projectUserToken— a short-lived JWT obtained from your backend viaPOST /v1/api/projects/user-token(see Backend Setup)
Application Query Parameters
Only compatible with project users — the
/share/application/ route requires a project user JWT obtained from POST /v1/api/projects/user-token. Legacy tenant JWTs are not supported for application embeds.Deploying Chat via iFrame
You’ll need to get the JWT for the current user and the agent ID to render the chat interface. The JWT is generated by following the steps in Backend Setup.Getting the Agent ID
You can find your agent ID by visiting your agents at https://ai-hub.upsolve.ai/agents. The agent ID is visible in the URL when you click on an agent, or in the agent list view.
Authentication via JWT: Chat iframes use JWT tokens passed via query
parameters for authentication, similar to dashboards. Users don’t need to be
logged into the Hub - they just need a valid JWT token in the URL.
Deploying Chat via React SDK
For a more integrated experience, use theUpsolveChat React component from @upsolve-labs/sdk. This handles all rendering and chat interactions without needing to manage an iFrame manually.
agentId— your agent’s unique ID (see Getting the Agent ID above)projectUserToken— a short-lived JWT obtained from your backend viaPOST /v1/api/projects/user-token(see Backend Setup)
Preview Link Generator (Hub UI)
The agent Deploy tab in the Hub provides a built-in preview link generator so you can quickly test your agent as a specific project user — no backend integration required. How it works:- Open your agent in the Hub and navigate to the Deploy tab.
- Select a project user from the dropdown (defaults to the currently active project user).
- Click Generate preview iframe link — this creates a 1-hour JWT token and produces a fully working chat URL.
- Open the URL in a browser or paste it into an iFrame to preview the agent experience for that user.
Chat Query Parameters
The chat iframe supports the following query parameters:placeholderOverrides Schema
exampleQuestions Example
Example with Initial Prompt
Understanding Session Reset on JWT Change
When theupsolveToken value changes, React re-renders the iframe with a new src URL. This causes the browser to completely reload the iframe and start a new chat session.
- Automatic token refresh (every hour)
- User switches between tenants/organizations
- User logs out and back in
- Tenant permissions are updated