Skip to main content
useFlightManager provides direct control over the flight lifecycle: starting, pausing, resuming, ending, and commenting on flights. It hydrates state from GET /api/flight-manager/state and subscribes to flight:manager Socket.io events for real-time updates. For most plugins, useTrackingSession is the better starting point — it wraps useFlightManager with derived state (isTracking, isPaused, elapsedTime, phase) and recovery handling. Use useFlightManager when you need lower-level control or want to avoid the extra derived state computation.

Import

Signature

Return value

Types

FlightPlan

See FlightPlan for the full shape.

StartFlightResult

See StartFlightResult for the full shape.

PreflightCheckResult

See PreflightCheckResult for the full shape (includes the nested PreflightCheck per-check entries).

CurrentFlight

See CurrentFlight for the full shape.

Usage

Start a flight

Run preflight checks first

End a flight

Notes

  • All action methods (startFlight, pauseFlight, etc.) call REST endpoints on the local shell server. They return a boolean or result object indicating success.
  • State updates arrive via flight:manager Socket.io events — the currentFlight value updates reactively without polling.
  • runPreflightChecks returns null if the server is unreachable.