> ## Documentation Index
> Fetch the complete documentation index at: https://docs.skybridge.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# useAppsSdkContext

> Read a raw ChatGPT host global by key

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.

```tsx highlight={4} theme={null}
import { useAppsSdkContext } from "skybridge/web";

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

## Type Parameters

### `K`

```tsx theme={null}
K extends keyof AppsSdkContext;
```

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

## Parameters

### `key`

```tsx theme={null}
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

```tsx theme={null}
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.

| Key | Value | Also via |
| - | - | - |
| `theme` | `"light"` or `"dark"` | [`useUser`](https://docs.skybridge.tech/api-reference/use-user) |
| `locale` | locale string, not canonicalized | [`useUser`](https://docs.skybridge.tech/api-reference/use-user) |
| `userAgent` | device type and input capabilities | [`useUser`](https://docs.skybridge.tech/api-reference/use-user) |
| `maxHeight` | max view height in pixels | [`useViewport`](https://docs.skybridge.tech/api-reference/use-viewport) |
| `displayMode` | current layout (`pip` / `inline` / `fullscreen` / `modal`) | [`useDisplayMode`](https://docs.skybridge.tech/api-reference/use-display-mode) |
| `safeArea` | insets to keep clear of host chrome | [`useViewport`](https://docs.skybridge.tech/api-reference/use-viewport) |
| `view` | current mode and modal params | [`useRequestModal`](https://docs.skybridge.tech/api-reference/use-request-modal) |
| `toolInput` | the tool call's arguments | [`useToolInfo`](https://docs.skybridge.tech/api-reference/use-tool-info) |
| `toolOutput` | the tool's structured output | [`useToolInfo`](https://docs.skybridge.tech/api-reference/use-tool-info) |
| `toolResponseMetadata` | the tool's response `_meta` | [`useToolInfo`](https://docs.skybridge.tech/api-reference/use-tool-info) |
| `widgetState` | persisted state: `modelContent` (model-shared), `privateContent` (view-only), `imageIds` | [`useViewState`](https://docs.skybridge.tech/api-reference/use-view-state) |

> [card] [useMcpAppContext](https://docs.skybridge.tech/api-reference/use-mcp-app-context.md)
>
> The same escape hatch for the MCP Apps runtime

> [card] [useToolInfo](https://docs.skybridge.tech/api-reference/use-tool-info.md)
>
> Read the tool result the view mounted with, cross-host

> [card] [ChatGPT Plugins and MCP Apps](https://docs.skybridge.tech/resources/chatgpt-and-mcp-apps.md)
>
> What the raw `window.openai` layer is, and how Skybridge unifies it


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.