Skip to main content

Quick Start

The fastest way to create a widget:
This creates:
  • server/tools/mywidget_tool.py - Python backend logic
  • widgets/mywidget/index.jsx - React frontend component

Widget Architecture

Core Concepts

1. Data Flow

2. File Structure

3. React Hooks

  • useWidgetProps() - Access tool output data
  • useWidgetState() - Manage persistent state
  • useOpenAiGlobal() - Access ChatGPT environment
  • useDisplayMode() / useMaxHeight() - Layout convenience hooks

Next Steps

Ready to start building?

Widget Basics

Learn the fundamentals

React Hooks

Master the hook system

Advanced Patterns

Complex interactions