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 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 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:
Learn more
To learn more about how to build an App, please read the Core Concepts and Interaction Model sections below.MCP Fundamentals
Learn the fundamentals of MCP servers and Apps
Data Flow
Understand how tools, widgets, and the model communicate
Type Safety
End-to-end type inference from server to widget