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
| Name | Value |
|---|---|
| Game ID | msfs |
| Scopes | msfs:read msfs:write |
Readable Data
Engine Data
| Name | Description |
|---|---|
| eng_throttle_1 | Engine 1 throttle position (percentage) |
| eng_throttle_2 | Engine 2 throttle position (percentage) |
| eng_throttle_3 | Engine 3 throttle position (percentage) |
| eng_throttle_4 | Engine 4 throttle position (percentage) |
| eng_rpm_1 | Engine 1 RPM |
| eng_rpm_2 | Engine 2 RPM |
| eng_rpm_3 | Engine 3 RPM |
| eng_rpm_4 | Engine 4 RPM |
| turb_eng_n1_1 | Engine 1 N1 |
| turb_eng_n1_2 | Engine 2 N1 |
| turb_eng_n1_3 | Engine 3 N1 |
| turb_eng_n1_4 | Engine 4 N1 |
| turb_eng_n2_1 | Engine 1 N2 |
| turb_eng_n2_2 | Engine 2 N2 |
| turb_eng_n2_3 | Engine 3 N2 |
| turb_eng_n2_4 | Engine 4 N2 |
| turb_eng_itt_1 | Engine 1 ITT |
| turb_eng_itt_2 | Engine 2 ITT |
| turb_eng_itt_3 | Engine 3 ITT |
| turb_eng_itt_4 | Engine 4 ITT |
| fuel_flow_gph_1 | Engine 1 fuel flow (gph) |
| fuel_flow_gph_2 | Engine 2 fuel flow (gph) |
| fuel_flow_gph_3 | Engine 3 fuel flow (gph) |
| fuel_flow_gph_4 | Engine 4 fuel flow (gph) |
| fuel_flow_pph_1 | Engine 1 fuel flow (pph) |
| fuel_flow_pph_2 | Engine 2 fuel flow (pph) |
| fuel_flow_pph_3 | Engine 3 fuel flow (pph) |
| fuel_flow_pph_4 | Engine 4 fuel flow (pph) |
| fuel_quantity_gallons | Total fuel quantity (gallons) |
| fuel_quantity_pounds | Total fuel quantity (pounds) |
Instrument Data
| Name | Description |
|---|---|
| indicated_altitude | Indicated altitude in feet |
| heading_gyro | Heading (gyro) in degrees |
| indicated_airspeed | Indicated airspeed (knots) |
| true_heading | True heading (degrees) |
| attitude_indicator_pitch | Attitude indicator pitch (degrees) |
| attitude_indicator_roll | Attitude indicator roll (degrees) |
| kohlsman_setting_hg | Altimeter setting (inches of mercury) |
| autopilot_altitude_set | Autopilot altitude setting (feet) |
Position Data
| Name | Description |
|---|---|
| latitude | Latitude (degrees) |
| longitude | Longitude (degrees) |
| plane_altitude | Plane altitude (feet) |
| on_ground | Will return 1 if the aircraft is on the ground, and 0 if it is not |
Velocity Data
| Name | Description |
|---|---|
| ground_speed | Ground speed (knots) |
| vertical_speed | Vertical speed (ft/m) |
| gforce | G-force |
Autopilot Data
| Name | Description |
|---|---|
| autopilot_master | Autopilot master switch (on/off) |
| autopilot_altitude_set | Autopilot target altitude (feet) |
| autopilot_altitude_lock | Altitude hold engaged (on/off) |
| autopilot_heading_lock | Heading hold engaged (on/off) |
| autopilot_heading_set | Autopilot target heading (degrees) |
| autopilot_vertical_hold | Vertical speed hold engaged (on/off) |
| autopilot_vertical_speed_set | Autopilot target vertical speed (ft/min) |
| autopilot_airspeed_hold | Airspeed hold engaged (on/off) |
| autopilot_airspeed_set | Autopilot target airspeed (knots) |
| autopilot_approach_hold | Approach mode engaged (on/off) |
| autopilot_nav1_lock | NAV1 lock engaged (on/off) |
| autopilot_flight_director | Flight director active (on/off) |
Flight Controls
| Name | Description |
|---|---|
| flaps_handle_percent | Flaps handle position (percentage) |
| flaps_left_percent | Left flaps position (percentage) |
| flaps_right_percent | Right flaps position (percentage) |
| spoilers_handle_percent | Spoilers handle position (percentage) |
| spoilers_left_percent | Left spoilers position (percentage) |
| spoilers_right_percent | Right spoilers position (percentage) |
| gear_handle_position | Gear handle position (up/down) |
| gear_left_position | Left gear position (percentage) |
| gear_center_position | Center gear position (percentage) |
| gear_right_position | Right gear position (percentage) |
| brake_left_position | Left brake position (percentage) |
| brake_right_position | Right brake position (percentage) |
| parking_brake | Parking brake engaged (on/off) |
Lighting
| Name | Description |
|---|---|
| light_landing | Landing lights (on/off) |
| light_taxi | Taxi lights (on/off) |
| light_beacon | Beacon lights (on/off) |
| light_nav | Navigation lights (on/off) |
| light_strobe | Strobe lights (on/off) |
Environment
| Name | Description |
|---|---|
| ambient_temperature | Outside air temperature (°C) |
| ambient_pressure | Ambient pressure (inHg) |
| sea_level_pressure | Sea level pressure (inHg) |
Wind Data
| Name | Description |
|---|---|
| ambient_wind_direction | Wind direction (degrees) |
| ambient_wind_velocity | Wind velocity (knots) |
| aircraft_wind_x | Wind component X-axis (knots) |
| aircraft_wind_y | Wind component Y-axis (knots) |
| aircraft_wind_z | Wind component Z-axis (knots) |
Warnings
| Name | Description |
|---|---|
| stall_warning | Stall warning active |
| overspeed_warning | Overspeed warning active |
Simulation State
| Name | Description |
|---|---|
| sim_paused | Simulation is paused |
| pitot_heat | Pitot heat active |