Skip to content

Quick Start

Get connected to GameGlue in 5 minutes. For a complete walkthrough building a full project, see Build Your First Flight Dashboard.

1. Register Your App

Go to the Developer Hub and create an application. You'll get a Client ID.

2. Install the SDK

sh
npm i gameglue
sh
yarn add gameglue
html
<script src="https://unpkg.com/gameglue/dist/gg.umd.js"></script>

3. Initialize and Authenticate

javascript
const ggClient = new GameGlue({
  clientId: '<your-client-id>',
  redirect_uri: '<your-app-url>',
  scopes: ['msfs:read', 'msfs:write']
});

const isAuthed = await ggClient.isAuthenticated();

if (!isAuthed) {
  ggClient.login();
  return;
}

const userId = ggClient.getUser();

4. Listen for Data

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

listener.on('update', (evt) => {
  console.log(evt.data);
});

5. Send Commands

javascript
const result = await listener.sendCommand('autopilot_on', true);

if (result.status === 'success') {
  console.log('Command sent');
}

Next Steps