This is the assistant-ui starter project with Assistant Cloud integration and Clerk for authentication.
- Sign up for Assistant Cloud at cloud.assistant-ui.com
- Create a new project in your Assistant Cloud dashboard
- Navigate to your project settings to get:
- Your Assistant Cloud API URL
Follow the docs guide to connect Clerk to Assistant Cloud (JWT template + Auth Rule): https://www.assistant-ui.com/docs/cloud/authorization#setting-up-the-clerk-auth-provider
Setting up the Clerk Auth Provider
-
Go to the Clerk dashboard and under "Configure" tab, "JWT Templates" section, create a new template. Choose a blank template and name it "assistant-ui".
-
As the "Claims" field, enter the following:
{
"aud": "assistant-ui"
}Note: The aud claim ensures that the JWT is only valid for the assistant-ui API.
- You can leave everything else as default. Take note of the "Issuer" and "JWKS Endpoint" fields.
- In the assistant-cloud dashboard settings, navigate to the "Auth Rules" tab and create a new rule.
- Choose "Clerk" and enter the Issuer and JWKS Endpoint from the previous step. As the "Audience" field, enter "assistant-ui".
Copy the example env file and then edit your values:
cp .env.example .env.local # macOS/Linux
copy .env.example .env.local # or on Windowspnpm installpnpm devOpen http://localhost:3000 with your browser to see the result.
- Click “Go to Chat”
- If you’re signed out, you’ll be redirected to the embedded sign-in page
- After sign-in, you’ll be returned to
/chat
You can start customizing the UI by modifying components in the components/assistant-ui/ directory.
app/page.tsx— Public landing page (top-right auth controls, “Go to Chat” CTA)app/chat/page.tsx— Protected chat page (Assistant UI)app/assistant.tsx— Assistant runtime setup (Assistant Cloud + Clerk token)app/api/chat/route.ts— Demo chat API endpoint using OpenAIapp/sign-in/[[...sign-in]]/page.tsx— Embedded Clerk sign-inapp/sign-up/[[...sign-up]]/page.tsx— Embedded Clerk sign-upapp/layout.tsx— App wrapper withClerkProvider(embedded routes configured)middleware.ts— Protects/chatand/api, keeps/public