Use skybridge/web
This guide shows you how to useskybridge/web without skybridge/server to add React hooks and utilities to your widgets.
Prerequisites
You should already have:- A working ChatGPT app MCP server backend (in any technology)
- Node.js 24+
Install
Add Skybridge to your project:Package overview
skybridge/web provides React hooks and utilities for building advanced ChatGPT Apps:
State Management
useToolInfo: Get initial tool input, output and metadatauseWidgetState: Persist state across widget renders
User Interface
useLayout: Get the current user layout and visual environment informationuseDisplayMode: Get and request widget display mode changesuseRequestModal: Open a modal portaled outside of the widget iframeuseUser: Get the session-stable user information (locale and userAgent)
Actions
useCallTool: Call tools from within a widgetuseOpenExternal: Open external linksuseSendFollowUpMessage: Send a follow-up message in the conversationuseFiles: Upload and download files
Others
useAppsSdkContext: Low-level hook to subscribe towindow.openaistate valuesgenerateHelpers: Generate typed helpers for your widgets (requiresskybridge/server)
Basic example
Here’s a simple widget using Skybridge hooks:Type safety without server
If you’re not usingskybridge/server, you won’t get automatic type inference. You can still add types manually:
