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.
Type Parameters
K
key: the literal key you pass fixes the return type to AppsSdkContext[K].
Parameters
key
Returns
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.
| Key | Value | Also via |
|---|---|---|
theme | "light" or "dark" | useLayout |
locale | locale string, not canonicalized | useUser |
userAgent | device type and input capabilities | useUser |
maxHeight | max view height in pixels | useLayout |
displayMode | current layout (pip / inline / fullscreen / modal) | useDisplayMode |
safeArea | insets to keep clear of host chrome | useLayout |
view | current mode and modal params | useRequestModal |
toolInput | the tool call’s arguments | useToolInfo |
toolOutput | the tool’s structured output | useToolInfo |
toolResponseMetadata | the tool’s response _meta | useToolInfo |
widgetState | persisted state: modelContent (model-shared), privateContent (view-only), imageIds | useViewState |
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