Overview
If you already have a React project and want to use sunpeak for runtime APIs or testing, you can integrate the sunpeak library directly without using the framework.Starting from scratch? Use Quickstart for the recommended ChatGPT App creation experience.
Prerequisites
Your existing project needs:React
Version 19
Node.js
Version 20 or higher
Build Tool
Vite recommended
Installation Steps
1
Install sunpeak
Add sunpeak to your project dependencies:If you only want to use sunpeak simulation and testing functionality (without the runtime APIs),
you can add sunpeak to
- pnpm
- npm
- yarn
devDependencies instead.2
Install styles (Tailwind)
sunpeak requires Tailwind CSS 4. If you don’t have it installed:Configure Tailwind in your build config, if it isn’t set up already:Import Tailwind and ChatGPT styles to your CSS entrypoint:
- pnpm
- npm
- yarn
- Vite
- Webpack
3
Create simulation files
Create a resource metadata JSON file:Create a simulation JSON file:
4
Wire up the simulator
Create an entrypoint file (like Add a script to run your simulation dev server (Run your local development server:
dev/main.tsx) where you want to run your simulator:package.json):- pnpm
- npm
- yarn
5
Wire up the MCP server
Create an MCP server file (like Add scripts to build and run your MCP server (Build your app and start the MCP server:See runMCPServer API Reference for configuration options and connecting to ChatGPT via tunnel.
mcp/server.ts) to serve your built widgets to ChatGPT:package.json):- pnpm
- npm
- yarn