Overview
If you already have a React project and want to add ChatGPT widget capabilities, you can integrate the sunpeak library directly.Starting from scratch? Use the Quickstart guide to create a new project with the sunpeak Starter Kit.
Prerequisites
Your existing project needs:React
Version 18 or 19
React DOM
Version 18 or 19
Node.js
Version 20 or higher
Build Tool
Vite recommended (Webpack/Parcel also work)
Installation Steps
1
Install sunpeak
Add sunpeak to your project dependencies:
- pnpm
- npm
- yarn
2
Install Tailwind CSS 4
sunpeak requires Tailwind CSS 4. If you don’t have it installed:Configure Tailwind in your build config:
- Vite
- Webpack
3
Wrap with ChatGPT Simulator
For local development, wrap your widget with the ChatGPT Simulator:
4
Build your widget
Build your widget with sunpeak APIs.
Configuration Options
TypeScript
If using TypeScript, sunpeak types are included. Update yourtsconfig.json if needed:
Tailwind Configuration
Add to your CSS entrypoint:Need the Full Starter Kit?
If you want the complete development setup with pre-built components, build tools, and testing framework, create a new project instead. See the Quickstart guide for details.Multi-Platform APIs
Start using sunpeak multi-platform APIs