JavaScript SDK
The JavaScript SDK provides useful utilities to interact with the Airplane platform.
Installation
The Airplane JavaScript SDK is available as an NPM package
airplane
.bashCopied1$ npm install airplane
bashCopied1$ yarn add airplane
Basic usage
Here is a simple example of how the SDK can be used to:
- Select users from a database filtered by name
- Display the selected users in a table
- Return the number of users that matched
typescriptCopied1import airplane from "airplane";23export default airplane.task(4{5slug: "lookup_users",6name: "Lookup users",7parameters: {8name: "shorttext",9},10resources: ["demo_db"],11},12async (params) => {13console.log(`Looking up users like '${params.name}'`);14const run = await airplane.sql.query<{15id: string;16name: string;17email: string;18}>(19"demo_db",20`21select id, name, email from users22where (name ilike :name or email ilike :name)23order by name asc24`,25{ args: { name: `%${params.name}%` } }26);2728const users = run.output.Q1;29await airplane.display.table(users);3031return {32numUsers: users.length,33};34}35);

Concepts
The SDK reference is broken out into pages for each concept. For details and examples, see the pages
below.