The Challenge
When building ChatGPT Apps the traditional way, your development loop looks like:- Make a code change
- Restart your server
- Tunnel with ngrok (if not already running)
- Go to ChatGPT dev mode
- Trigger the tool manually by chatting
- Wait for the widget to load
- See if your change worked
- Repeat
The Skybridge Approach
With Skybridge, the loop becomes:- Make a code change
- See it instantly in your browser
Local Emulator
When you runpnpm dev, Skybridge starts:
- Your MCP server at
http://localhost:3000/mcp - DevTools UI at
http://localhost:3000/
- Tool listing - See all registered tools and widgets
- Input forms - Test tools with custom inputs
- Widget preview - Render widgets in a mocked ChatGPT environment

Using the Emulator
- Open
http://localhost:3000/in your browser - Select a tool from the sidebar
- Fill in the input form and click “Call Tool”
- See the widget render in the preview pane
window.openaiAPI (theme, locale, display mode, etc.)- Tool call responses
- Widget state persistence
- Follow-up message sending
Emulator limitationsThe local emulator uses ChatGPT’s rendering environment but has some differences:
- CSP policies: Some external resources may be blocked in production but allowed locally
- LLM responses: Follow-up messages don’t trigger actual LLM responses—test these in ChatGPT dev mode
HMR with Vite Plugin
Skybridge includes a Vite plugin that enables Hot Module Replacement for widgets:- Auto-discovers widgets in
src/widgets/(both flat files and directories) - Enables HMR so changes appear instantly without page reload
- Transforms
data-llmattributes at build time - Configures build output with proper asset paths
Starter template requiredThese features require the Skybridge starter template structure (
pnpm create skybridge). If you’re adding Skybridge to an existing app, you’ll need to configure the Vite plugin manually.Automatic Environment Detection
Your widget code works identically in ChatGPT and local DevTools. Skybridge detects the environment and uses the appropriate communication layer:| Environment | Communication |
|---|---|
| ChatGPT | window.openai API |
| DevTools | postMessage to emulator |
When to Use What
Local Emulator (90% of development time)- Rapid UI iteration
- Testing tool inputs/outputs
- Debugging state management
- Day-to-day development
- Final integration testing
- Real LLM conversation flow
- Verifying
data-llmcontext - Pre-ship validation
DevTools Features
The DevTools UI includes:Tool Inspector
See all registered tools and their schemas. Click to fill input forms automatically.Widget Preview
Renders your widget in an iframe with mockedwindow.openai. Supports:
- Theme switching (light/dark)
- Display mode switching (pip/inline/fullscreen)
- Locale changing
Response Inspector
View the full tool response includingcontent, structuredContent, and _meta.
Related
- Test Your App - Full testing workflow including ChatGPT dev mode
- DevTools - Detailed DevTools documentation
- useLayout API - Access theme and layout info
- useCallTool API - Make tool calls from widgets
