Skip to main content
ctx.airline (PluginAirlineAccessor) gives read-only access to the currently-bound airline plus a pre-configured HTTP client. See PluginAirlineAccessor and PluginAirline for the full shapes.

getCurrent()

Returns the current airline binding. Re-call it when you need a fresh snapshot — there’s no event subscription.
Returns an axios instance pre-configured for the bound airline:
  • baseURL is set to airline.baseUrl (resolved per request).
  • Authorization header carries the current VA bearer.
  • On a 401 response, the shell exchanges the stored refresh token at the VA’s refresh_url. If refresh succeeds, the request is retried exactly once. If the VA didn’t configure a refresh_url, the user has no refresh token, or the VA rejected the refresh, the 401 propagates and the shell’s existing re-auth flow takes over.
Cache the returned instance for the lifetime of the background module — it’s safe to reuse across requests.
When to use it: any time your background module calls the airline’s backend. createClient() is the recommended path (refresh handling for free); reach for getCurrent() when you only need the airline’s identity or base URL. The renderer-side equivalent is useVaApi().