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

# usePluginContext

> Access the plugin UI context.

`usePluginContext` returns the full `PluginUIContext` object that the shell injects into every plugin's React tree via `PluginShellProvider`. It is the foundational hook — all other shell utility hooks (`useShellAuth`, `useShellToast`, etc.) call it internally.

## Import

```ts theme={null}
import { usePluginContext } from "@skyvexsoftware/stratos-sdk";
```

## Signature

```ts theme={null}
function usePluginContext(): PluginUIContext
```

## Return value

See [`PluginUIContext`](/sdk/type-reference#pluginuicontext) for the full shape.

The nested types referenced by `PluginUIContext` are also documented in the Type Reference:

* [`PluginNavigationHelper`](/sdk/type-reference#pluginnavigationhelper)
* [`PluginToastAPI`](/sdk/type-reference#plugintoastapi)
* [`PluginLogger`](/sdk/type-reference#pluginlogger)
* [`PluginPilotUser`](/sdk/type-reference#pluginpilotuser)

## Usage

```tsx theme={null}
import { usePluginContext } from "@skyvexsoftware/stratos-sdk";

export function MyComponent() {
  const { auth, airline, toast } = usePluginContext();

  return (
    <div>
      <p>Airline: {airline?.name ?? "Unknown"}</p>
      {auth.isAuthenticated && auth.user ? (
        <p>Welcome, {auth.user.firstName} {auth.user.lastName}</p>
      ) : (
        <p>Not authenticated</p>
      )}
      <button onClick={() => toast.success("Saved!")}>Save</button>
    </div>
  );
}
```

## Notes

* Convenience wrappers like `useShellAuth`, `useShellToast`, etc. are available if you only need a single field from the context. They call `usePluginContext()` internally.
* The `socket` field is the plugin-scoped bridge to your own background module's `ctx.ipc.send` broadcasts. For high-frequency simulator data sourced from outside your plugin, use `useSimData` or `useSocket` instead.
