- iFrame Embedding
- Native React Component Embedding ๐
- iFrame Embedding
- Native React Component Embedding ๐
Please click on the Deploy button in the Hub.
You will need to get the JWT for the current user and the dashboard ID to render the correct dashboard. The JWT is generated by following the steps in Backend Setup. The dashboard ID could be found in the URL when you are viewing the dashboard you want to embed.Below is an example of deploying component with JWT using Clerk middleware:Optional: Lock to a specific dashboard versionCommon scenarios that trigger iframe reload:

Understanding JWT Changes and Iframe Refresh
When theupsolveToken value changes in the code above, React will re-render the component with a new src URL for the iframe. This causes the browser to completely reload the iframe content.- Automatic token refresh (every hour)
- User switches between tenants/organizations
- User logs out and back in
- Tenant permissions are updated
Database Row-Level Security (RLS) Setup ๐
Database Row-Level Security (RLS) Setup ๐
For databases with Row-Level Security policies (Postgres, Redshift, or Supabase), you need to include a database auth token (Learn more about setting up RLS for Postgres and Redshift in the Database Row-Level Security guide.Refer to the Supabase API docs for more details on managing sessions and tokens.
dbAuthToken) in the iFrame src URL. This token identifies the current user and is used by your databaseโs RLS policies to filter data at the row level.Example updated iFrame URL:- dbAuthToken: The user-specific identifier that your RLS policies use for row-level filtering
For Postgres and Redshift
ThedbAuthToken should contain the value that matches your RLS session variable (e.g., tenant ID, user ID, or company code):For Supabase
To retrieve the Supabase session token (dbAuthToken), you can use Supabaseโs auth.getSession method:Deploying AI Chat
There are two ways to deploy AI chat in your front end:- iFrame Embedding
- Native React Component Embedding ๐
- iFrame Embedding
- Native React Component Embedding ๐
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.
Below is an example of deploying chat with JWT using Clerk middleware:
Common scenarios that trigger session reset:
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.
Dashboard Query Parameters
The dashboard iframe supports the following query parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
jwt | string | Yes | Tenant JWT for authentication |
theme | light | dark | No | Visual theme |
version | number | No | Lock to a specific dashboard version (defaults to latest) |
hideHeader | boolean | No | Hide the header UI |
hideDownloadButton | boolean | No | Hide the download button |
themeConfigs | JSON string | No | Custom theme configuration |
dbAuthToken | string | No | Database authentication token for RLS (see RLS section) |
filter_{key} | any | No | Controlled filter values (e.g., filter_region=US) |
Version Locking
You can lock an embedded dashboard to a specific version using theversion parameter. This ensures that the dashboard renders with a specific configuration, even if newer versions are published.Chat Query Parameters
The chat iframe supports the following query parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
jwt | string | Yes | Tenant JWT for authentication |
prompt | string | No | Initial prompt to start the conversation |
theme | light | dark | No | Visual theme |
isAdmin | boolean | No | Enable admin features (default: false) |
hideHeader | boolean | No | Hide the header UI |
themeConfigs | JSON string | No | Custom theme configuration |
Example with Initial Prompt
Admin Mode
By default, the chat interface runs in end-user mode with simplified views. SetisAdmin=true to enable detailed tool execution information: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
