Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@flybywiresim/api-client
Advanced tools
The official JavaScript client for the FBW API. The library supports both JavaScript and TypeScript.
Install the client library using npm:
$ npm install --save @flybywiresim/api-client
import { NXApi } from '@flybywiresim/api-client';
NXApi.url = new URL('http://localhost:3000');
By default, the URL is set to https://api.flybywiresim.com
. If this is the desired URL this step can be omitted.
import { Metar } from '@flybywiresim/api-client';
Metar.get(icao, source)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
icao
is a string of the the airport ICAO code to get the METAR for.source
is the selected datasource for the METAR and is optional.
Valid sources are:
import { Taf } from '@flybywiresim/api-client';
Taf.get(icao, source)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
icao
is a string of the the airport ICAO code to get the TAF for.source
is the selected datasource for the TAF and is optional.
Valid sources are:
import { Atis } from '@flybywiresim/api-client';
Atis.get(icao, source)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
icao
is a string of the the airport ICAO code to get the ATIS for.source
is the selected datasource for the ATIS and is optional.
Valid sources are:
import { Airport } from '@flybywiresim/api-client';
Airport.get(icao)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
icao
is a string of the the airport ICAO code to search for.import { Telex } from '@flybywiresim/api-client';
Telex.connect(status)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
status
is of type AircraftStatus
and contains information about the current flight.The backend might block certain flight numbers from being used for various reasons.
import { Telex } from '@flybywiresim/api-client';
Telex.update(status)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
status
is of type AircraftStatus
and contains information about the current flight.The status has to updated every 6 minutes for the connection to stay alive. It is recommended to update the status every 15 seconds for a usable live map. The status can only be updated once a connection has been established.
import { Telex } from '@flybywiresim/api-client';
Telex.disconnect()
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
The connection can only be disconnected once it has been established. This releases the flight number for reuse and removes the flight from the live map.
import { Telex } from '@flybywiresim/api-client';
Telex.sendMessage(recipient, message)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
recipient
is a string containing the flight number of the recipient flight.message
is a string containing the message to send.Messages will be filtered for profanity in the backend.
import { Telex } from '@flybywiresim/api-client';
Telex.fetchMessages()
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
Messages can only be received once and will be acknowledged by this transaction.
import { Telex } from '@flybywiresim/api-client';
Telex.fetchConnections(skip, take, bounds)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
skip
is a number and tells the backend to skip the first n connections.take
is a number and tells the backend how many connections to send.bounds
is an optional bounding box. Query only connections within this area.take
and skip
are used to control the pagination. A maximum of 100 entries can be fetched at a time.
import { Telex } from '@flybywiresim/api-client';
Telex.fetchAllConnections(bounds, callback)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
bounds
is an optional bounding box. Query only connections within this area.callback
gets called after every fetched page.import { Telex } from '@flybywiresim/api-client';
Telex.fetchConnection(id)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
id
is the unique identifier of the connection.import { Telex } from '@flybywiresim/api-client';
Telex.findConnection(flight)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
flight
is the flight number to search for.import { Telex } from '@flybywiresim/api-client';
Telex.countConnections()
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
import { GitVersions } from '@flybywiresim/api-client';
GitVersions.getNewestCommit(user, repo, branch)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
user
the owner of the repository.repo
the repository.branch
the requested branch.import { GitVersions } from '@flybywiresim/api-client';
GitVersions.getReleases(user, repo)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
user
the owner of the repository.repo
the repository.import { GitVersions } from '@flybywiresim/api-client';
GitVersions.getPulls(user, repo)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
user
the owner of the repository.repo
the repository.import { GitVersions } from '@flybywiresim/api-client';
GitVersions.getArtifact(user, repo, pull)
.then(data => {
console.log(data);
}).catch(err => {
console.error(err);
});
user
the owner of the repository.repo
the repository.pull
the number of the pull request.This software is licensed under the MIT license.
FAQs
Client library for the FlyByWire Simulations API
The npm package @flybywiresim/api-client receives a total of 509 weekly downloads. As such, @flybywiresim/api-client popularity was classified as not popular.
We found that @flybywiresim/api-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.