Skip to content

Microsoft Flight Simulator

In this early access version of GameGlue, we only support reading the Microsoft Flight Simulator (MSFS) game state. In future updates, we'll also allow for you to control the simulator using the GameGlue SDK.

Additionally, the amount of data returned is somewhat limited, but as we get closer to the full release of GameGlue, we aim to support everything the SimConnect protocol supports.

Getting Started

Initialize the SDK

javascript
const ggClient = new GameGlue({
  clientId: '<your-application-id>',
  redirect_uri: '<your-redirect-uri>',
  scopes: ['msfs:read', 'msfs:write'] // You can omit the write scope if you don't plan to control the simulator
});

Authenticate the user

javascript
await ggClient.auth(); // This will redirect the user to the GameGlue login page
const userId = ggClient.getUserId();

Create a listener

javascript
const userListener = await ggClient.createListener({
  userId: userId,
  gameId: 'msfs'
});

Use the listener

javascript
userListener.on('update', (evt) => {
  const { ground_speed } = evt.data;
  document.body.innerHTML = ground_speed;
});

Subscribe to specific fields

To reduce bandwidth, specify only the fields you need:

javascript
const userListener = await ggClient.createListener({
  userId: userId,
  gameId: 'msfs',
  fields: ['ground_speed', 'indicated_altitude', 'autopilot_master']
});

SDK Settings

NameValue
Game IDmsfs
Scopesmsfs:read msfs:write

Readable Data

Engine Data

NameDescription
eng_throttle_1Engine 1 throttle position (percentage)
eng_throttle_2Engine 2 throttle position (percentage)
eng_throttle_3Engine 3 throttle position (percentage)
eng_throttle_4Engine 4 throttle position (percentage)
eng_rpm_1Engine 1 RPM
eng_rpm_2Engine 2 RPM
eng_rpm_3Engine 3 RPM
eng_rpm_4Engine 4 RPM
turb_eng_n1_1Engine 1 N1
turb_eng_n1_2Engine 2 N1
turb_eng_n1_3Engine 3 N1
turb_eng_n1_4Engine 4 N1
turb_eng_n2_1Engine 1 N2
turb_eng_n2_2Engine 2 N2
turb_eng_n2_3Engine 3 N2
turb_eng_n2_4Engine 4 N2
turb_eng_itt_1Engine 1 ITT
turb_eng_itt_2Engine 2 ITT
turb_eng_itt_3Engine 3 ITT
turb_eng_itt_4Engine 4 ITT
fuel_flow_gph_1Engine 1 fuel flow (gph)
fuel_flow_gph_2Engine 2 fuel flow (gph)
fuel_flow_gph_3Engine 3 fuel flow (gph)
fuel_flow_gph_4Engine 4 fuel flow (gph)
fuel_flow_pph_1Engine 1 fuel flow (pph)
fuel_flow_pph_2Engine 2 fuel flow (pph)
fuel_flow_pph_3Engine 3 fuel flow (pph)
fuel_flow_pph_4Engine 4 fuel flow (pph)
fuel_quantity_gallonsTotal fuel quantity (gallons)
fuel_quantity_poundsTotal fuel quantity (pounds)

Instrument Data

NameDescription
indicated_altitudeIndicated altitude in feet
heading_gyroHeading (gyro) in degrees
indicated_airspeedIndicated airspeed (knots)
true_headingTrue heading (degrees)
attitude_indicator_pitchAttitude indicator pitch (degrees)
attitude_indicator_rollAttitude indicator roll (degrees)
kohlsman_setting_hgAltimeter setting (inches of mercury)
autopilot_altitude_setAutopilot altitude setting (feet)

Position Data

NameDescription
latitudeLatitude (degrees)
longitudeLongitude (degrees)
plane_altitudePlane altitude (feet)
on_groundWill return 1 if the aircraft is on the ground, and 0 if it is not

Velocity Data

NameDescription
ground_speedGround speed (knots)
vertical_speedVertical speed (ft/m)
gforceG-force

Autopilot Data

NameDescription
autopilot_masterAutopilot master switch (on/off)
autopilot_altitude_setAutopilot target altitude (feet)
autopilot_altitude_lockAltitude hold engaged (on/off)
autopilot_heading_lockHeading hold engaged (on/off)
autopilot_heading_setAutopilot target heading (degrees)
autopilot_vertical_holdVertical speed hold engaged (on/off)
autopilot_vertical_speed_setAutopilot target vertical speed (ft/min)
autopilot_airspeed_holdAirspeed hold engaged (on/off)
autopilot_airspeed_setAutopilot target airspeed (knots)
autopilot_approach_holdApproach mode engaged (on/off)
autopilot_nav1_lockNAV1 lock engaged (on/off)
autopilot_flight_directorFlight director active (on/off)

Flight Controls

NameDescription
flaps_handle_percentFlaps handle position (percentage)
flaps_left_percentLeft flaps position (percentage)
flaps_right_percentRight flaps position (percentage)
spoilers_handle_percentSpoilers handle position (percentage)
spoilers_left_percentLeft spoilers position (percentage)
spoilers_right_percentRight spoilers position (percentage)
gear_handle_positionGear handle position (up/down)
gear_left_positionLeft gear position (percentage)
gear_center_positionCenter gear position (percentage)
gear_right_positionRight gear position (percentage)
brake_left_positionLeft brake position (percentage)
brake_right_positionRight brake position (percentage)
parking_brakeParking brake engaged (on/off)

Lighting

NameDescription
light_landingLanding lights (on/off)
light_taxiTaxi lights (on/off)
light_beaconBeacon lights (on/off)
light_navNavigation lights (on/off)
light_strobeStrobe lights (on/off)

Environment

NameDescription
ambient_temperatureOutside air temperature (°C)
ambient_pressureAmbient pressure (inHg)
sea_level_pressureSea level pressure (inHg)

Wind Data

NameDescription
ambient_wind_directionWind direction (degrees)
ambient_wind_velocityWind velocity (knots)
aircraft_wind_xWind component X-axis (knots)
aircraft_wind_yWind component Y-axis (knots)
aircraft_wind_zWind component Z-axis (knots)

Warnings

NameDescription
stall_warningStall warning active
overspeed_warningOverspeed warning active

Simulation State

NameDescription
sim_pausedSimulation is paused
pitot_heatPitot heat active