Skip to main content

Overview

The ChatGPT Simulator is a local development environment that replicates ChatGPT’s widget runtime. It lets you build and test your widgets instantly without deploying to production. ChatGPT Simulator

Why Use the Simulator?

Instant Feedback

See changes immediately with hot module replacement

Test All Modes

Switch between light/dark themes and mobile/tablet/desktop views

No Deployment Needed

Develop locally without setting up MCP servers

Full Runtime Access

All ChatGPT runtime APIs work in the simulator

Quick Start

If you set up your project via the sunpeak Starter Kit, the simulator is already set up!
Wrap your widget with the simulator in development:
import 'sunpeak/style.css'; // Required to style the simulator.
import { ChatGPTSimulator } from 'sunpeak';
import { MyWidget } from './MyWidget';

function App() {
  return (
    <ChatGPTSimulator>
      <MyWidget />
    </ChatGPTSimulator>
  );
}
Start your dev server and you’re ready to go:
pnpm dev

What Gets Simulated

The simulator provides a complete ChatGPT-like environment including:
  • Runtime APIs: Full access to window.openai including theme, display mode, and state management
  • UI Environment: ChatGPT’s chat interface, message bubbles, and widget containers
  • User Interactions: All standard interactions like clicks, form submissions, and navigation
The simulator is for development only. For production testing with real ChatGPT, use the MCP Server.

Dive Deeper

ChatGPTSimulator API

Full component documentation and configuration options