Skip to main content
ChatGPT exposes its host context to your app, which Skybridge’s hooks read and normalize for you. useAppsSdkContext is the escape hatch: it reads a context value raw, by key, before that normalization. It works only under ChatGPT.

Example

useUser canonicalizes the locale (fr_FR becomes fr-FR). Reading it raw gives exactly what ChatGPT sent.
import { useAppsSdkContext } from "skybridge/web";

function LocaleBadge() {
  const locale = useAppsSdkContext("locale"); // raw, e.g. "fr_FR"
  return <span>{locale}</span>;
}

Type Parameters

K

K extends keyof AppsSdkContext;
Inferred from key: the literal key you pass fixes the return type to AppsSdkContext[K].

Parameters

key

key: K;
Required. The context key to read. The hook re-renders when the host pushes a new value for that key, and ignores changes to other keys.

Returns

value: AppsSdkContext[K];
The requested key’s current value, read live from window.openai. It is un-normalized: every key also has a cross-host hook that returns a wrapped form, so reach here only for the raw value.
KeyValueAlso via
theme"light" or "dark"useLayout
localelocale string, not canonicalizeduseUser
userAgentdevice type and input capabilitiesuseUser
maxHeightmax view height in pixelsuseLayout
displayModecurrent layout (pip / inline / fullscreen / modal)useDisplayMode
safeAreainsets to keep clear of host chromeuseLayout
viewcurrent mode and modal paramsuseRequestModal
toolInputthe tool call’s argumentsuseToolInfo
toolOutputthe tool’s structured outputuseToolInfo
toolResponseMetadatathe tool’s response _metauseToolInfo
widgetStatepersisted state: modelContent (model-shared), privateContent (view-only), imageIdsuseViewState

useMcpAppContext

The same escape hatch for the MCP Apps runtime

useToolInfo

Read the tool result the view mounted with, cross-host

Apps SDK and MCP Apps

What the raw Apps SDK layer is, and how Skybridge unifies it