Skip to main content
useShellAuth returns the current VA authentication state from the shell’s context. It is a convenience wrapper around usePluginContext().auth.

Import

Signature

Return value

PluginPilotUser

See PluginPilotUser for the full shape.

Usage

Guard pattern

Using the token

For calls to the bound airline’s API, prefer useVaApi() over reading token directly. useVaApi returns a pre-configured axios instance that attaches the bearer, sets the airline’s base_url, and refreshes the access token on 401 — none of which useShellAuth does.
Reach for useShellAuth().token only when you need the raw bearer — for example, when calling a non-VA service that happens to accept the same token, or when integrating with a third-party HTTP client you’ve already configured.

Notes

  • Auth state reflects the user’s VA login session (credentials or OAuth). It is not plugin-specific.
  • Auth state updates reactively when the user logs in or out — no polling or manual refresh is needed.
  • This hook is equivalent to usePluginContext().auth. Use whichever you prefer.