When constructing the client, you can optionally pass in an options object to set the data refresh rate. The mininum refresh rate is 15 seconds to avoid an IP ban from the IVAO API, and as such the default is also 15 seconds.
const client = new IvaoClient();
// OR
const client = new IvaoClient({ dataRefreshRate: 30 });
Get filtered ATC clients. An optional options object can be passed in to filter the ATCs by any of the keys in the IAtc interface. If no options object is passed, it will behave the same as getIvaoAtcsAll
const client = new IvaoClient();
const atcs = client.getIvaoAtcsFiltered({
limit: 10,
atcSession: {
position: 'GND',
}
});
Optional
options: IGetAtcsFilteredOptionsGet clients connected to the network with filtering applied. This can be used to get a specific subset of clients
as well as apply limits to the number of clients returned for each subset. An optional options object can be passed
with a single key of query
which is an array of objects with the following properties: keys
and limit
.
If no options object is passed, it will behave the same as getIvaoClientsAll
With options object and queries
const client = new IvaoClient();
const clients = ivaoClient.getIvaoClientsFiltered({
query: [
{
keys: ['pilots'],
limit: 3,
},
{
keys: ['observers', 'atcs'],
},
],
});
console.log(clients);
// output: {
// pilots: [
// { ... },
// { ... },
// { ... },
// ],
// observers: [
// { ... }, total observers
// ],
// atcs: [
// { ... }, total atcs
// ]
// }
Optional
options: IGetClientsFilteredOptionsGet connection metadata from the API. This includes the number of clients connected to each server, atc controllers, pilots, etc. An optional options object can be passed in to only return specific keys from the metadata object.
Get all metadata
const client = new IvaoClient();
const metadata = client.getIvaoConnectionsMetadata();
console.log(metadata);
// output: { total: 876, supervisor: 4, atc: 103, observer: 19, pilots: 754, worldTour: 132, followMe: 0 }
Get specific keys from metadata
const client = new IvaoClient();
const metadata = client.getIvaoConnectionsMetadata({ keys: ['total', 'atc'] });
console.log(metadata);
output: { total: 876, atc: 103 }
Optional
options: IGetConnectionsMetadataOptionsGets the entire unprocessed JSON data from the API. This can potentially be a large amount of data depending on network load at the time of request. Only use this if you would like to parse the data yourself, otherwise use the other methods included in the SDK.
const client = new IvaoClient();
const data = client.getIvaoDataRaw();
Get filtered observer clients. An optional options object can be passed in to filter the observers by any of the keys in the IObserver interface. If no options object is passed, it will behave the same as getIvaoObserversAll
const client = new IvaoClient();
const observers = client.getIvaoObserversFiltered({
rating: 3,
lastTrack: {
onGround: false,
}
});
Optional
options: IGetObserversFilteredOptionsGet filtered pilot clients. An optional options object can be passed in to filter the pilots by any of the keys in the IPilot interface. If no options object is passed, it will behave the same as getIvaoPilotsAll
const client = new IvaoClient();
const pilots = client.getIvaoPilotsFiltered({
limit: 10,
lastTrack: {
onGround: false,
}
});
Optional
options: IGetPilotsFilteredOptionsGet filtered world servers. An optional options object can be passed in to filter the servers by any of the keys in the IServer interface. At the time of writing this, only a single world/voice server exists.
const client = new IvaoClient();
const servers = client.getIvaoServersFiltered({
limit: 10,
countryId: 'US'
});
Optional
options: IGetServersFilteredOptionsGet filtered voice servers. An optional options object can be passed in to filter the servers by any of the keys in the IServer interface. At the time of writing this, only a single world/voice server exists.
const client = new IvaoClient();
const servers = client.getIvaoVoiceServersFiltered({
limit: 10,
countryId: 'US'
});
Optional
options: IGetServersFilteredOptionsGenerated using TypeDoc
Description
The main client class for interacting with the IVAO API