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.
useShellAuth returns the current VA authentication state from the shell’s context. It is a convenience wrapper around usePluginContext().auth.
Import
Signature
Return value
| Field | Type | Description |
|---|---|---|
isAuthenticated | boolean | true when the user is logged in to a VA (via credentials or OAuth). |
token | string | null | The current VA auth token, or null when not authenticated. |
user | PluginPilotUser | null | Pilot profile from the VA API, or null when not authenticated. |
PluginPilotUser
Usage
Guard pattern
Using the token
For calls to the bound airline’s API, preferuseVaApi() 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.
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.