useShellAuth returns the current authentication state from the shell’s context. It is a thin wrapper around usePluginContext().auth — calling it is equivalent but more readable in components that only need auth state.
Import
Signature
Return value
| Field | Type | Description |
|---|---|---|
isAuthenticated | boolean | true when the user is logged in to the shell’s Stratos account |
token | string | null | The current auth token, or null when not authenticated |
user | unknown | User profile data from the Stratos API. Cast to your VA’s user type. |
Usage
Guard pattern
Using the token
Notes
- Auth state is provided by the shell and reflects the user’s Stratos login session. It is not plugin-specific.
- The
userfield type isunknownbecause the shell does not enforce a specific user schema. Cast it to your VA’s user type or use a type guard. - Auth state updates reactively when the user logs in or out — no polling or manual refresh is needed.