
/projects/{projectId}/applications/{applicationId}.
Below is an example of deploying the application with a JWT using Clerk middleware:
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 organizations
- User logs out and back in
- User 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:Application Query Parameters
The application iframe supports the following query parameters:Deploying AI Chat
Deploy AI chat in your frontend by embedding it as an iFrame. You’ll need a project user token (JWT) for the current user and the agent ID to render the chat interface. The token 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 applications. Users don’t need to be
logged into the Hub - they just need a valid JWT token in the URL.
Chat Query Parameters
The chat iframe supports the following query parameters: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 organizations
- User logs out and back in
- User permissions are updated
