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 workspace ID to render the chat interface. The JWT is generated by following the steps in Backend Setup.Getting the workspace ID
A workspace’s embed is addressed by its project ID and workspace ID, which appear both in the workspace URL —/projects/{projectId}/workspaces/{workspaceId} — and in the embed snippet on the workspace’s Deploy page. The Deploy page builds the iframe for you, so copying it from there is the quickest path:

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— the ID of the workspace’s agent: the workspace ID from its URL (see Getting the workspace 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 workspace’s Deploy page 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 workspace in the Hub and navigate to the Deploy page.
- Select a project user under Preview it as one of your users.
- Click Generate preview 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