1.0.9 • Published 1 year ago

ivao-sdk v1.0.9

Weekly downloads
-
License
GNU General Publi...
Repository
github
Last release
1 year ago

IVAO-SDK

GitHub Workflow Status GitHub Workflow Status


Introduction

The IVAO-SDK is a wrapper for interacting with the IVAO API and pulling data from IVAO for use in any web app.

Installation

$ npm i ivao-sdk -D

Usage

To use the IVAO-SDK, import it into your project and instantiate a new instance of the IVAO class:

const ivaoSdk = require('ivao-sdk');

// instantiate new instance of IvaoClient
const ivaoClient = new ivaoSdk.IvaoClient(); // default data refresh rate of 15 seconds

// Listen for connected event to know when the client is ready to use.
ivaoClient.on('connected', () => {
  console.log('Connected to IVAO API');
  
  // The SDK also emits an event for when data is refreshed if you wish to perform logic on data refresh
    ivaoClient.on('dataRefreshed', () => {
        console.log('Data refreshed');
    });
});

When instantiating a new instance, you can optionally pass in an options object to specify the data refresh rate:

const ivaoClient = new ivaoSdk.IvaoClient({
  refreshRate: 30 // refresh data every 30 seconds
});

Quickstart Example

const ivaoSdk = require('ivao-sdk');
const ivaoClient = new ivaoSdk.IvaoClient();

ivaoClient.on('connected', () => {
  console.log('Connected to IVAO API');

  const pilots = ivaoClient.getIvaoPilotsFiltered({
    flightPlan: {
      aircraft: {
        icaoCode: 'B738',
      },
    },
  });

  console.log(pilots);
  console.log('Result count:', pilots.length);
});

Documentation

See the IVAO SDK documentation for more information and usage examples of the client methods.

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago