Example Next.js project demonstrating how to use Thesys GenUI SDK with C1 API in a standalone component, outside of a chat interface.
This project showcases how to integrate C1 component directly into your application without requiring a chat interface. Here's the overall flow:
- Application renders a form with a single input field to ask for a company name or domain
- UI makes a POST request to
/api/askroute with user input /api/askroute uses C1 API to generate a response- The response is rendered in the C1 component
- When user does some action on C1 component, it makes a POST request to
/api/askroute with the user action along with the previous C1 response for context.
C1Component usage is demonstrated in src/app/home/HomePage.tsx
- Copy env.example to .env and set THESYS_API_KEY, TAVILY_API_KEY
cp env.example .env- Install dependencies:
npm install- Run the development server:
npm run dev