• Stars
    star
    1,963
  • Rank 23,614 (Top 0.5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Airtable javascript client

The official Airtable JavaScript library.

Airtable.js

The Airtable API provides a simple way of accessing your data. Whether it's contacts, sales leads, inventory, applicant information or todo items, the vocabulary of the interactions closely matches your data structure. You will use your table names to address tables, column names to access data stored in those columns. In other words, the Airtable API is your own RESTful API for your base.

Installation

Node.js

To install Airtable.js in a node project:

npm install airtable

Airtable.js is compatible with Node 10 and above.

Browser

To use Airtable.js in the browser, use build/airtable.browser.js.

For a demo, run:

cd test/test_files
python -m SimpleHTTPServer

Edit test/test_files/index.html - put your BASE_ID and API_KEY (Be careful! You are putting your API key on a web page! Create a separate account and share only one base with it.)

Then open http://localhost:8000/ in your browser.

Airtable.js is compatible with browsers supported by the Airtable web app with the exception of Safari 10.0. Airtable.js supports Safari 10.1 and higher. See the technical requirements for more details.

Configuration

There are three configurable options available:

  • apiKey - your secret API token. Visit /create/tokens to create a personal access token. OAuth access tokens can also be used.
  • endpointUrl - the API endpoint to hit. You might want to override it if you are using an API proxy (e.g. runscope.net) to debug your API calls. (AIRTABLE_ENDPOINT_URL).
  • requestTimeout - the timeout in milliseconds for requests. The default is 5 minutes (300000).

You can set the options globally via Airtable.configure:

Airtable.configure({ apiKey: 'YOUR_SECRET_API_TOKEN' })

Globally via process env (e.g. in 12factor setup):

export AIRTABLE_API_KEY=YOUR_SECRET_API_TOKEN

You can also override the settings per connection:

const airtable = new Airtable({endpointUrl: 'https://api-airtable-com-8hw7i1oz63iz.runscope.net/'})

Interactive documentation

Go to https://airtable.com/api to see the interactive API documentation for your Airtable bases. Once you select a base, click the "JavaScript" tab to see code snippets using Airtable.js. It'll have examples for all operations you can perform against your base using this library.

You can also view non-interactive API documentation at https://airtable.com/developers/web/api.

Promises

As of v0.5.0 all of the methods that take a done callback will return a Promise if you don't pass in a done callback.

For example:

table.select().firstPage(result => { ... })

is equivalent to

table.select().firstPage().then(result => { ... })

Tests

Tests are run via npm run test.

We strive for 100% test coverage. Some aspects may not be testable or suitable for test coverage. The tooling supports ignoring specific parts of a file documented here; use that as appropriate.

When you run the tests a coverage report will be generated at ./coverage/lcov-report/index.html which you can access in the browser for line by line reporting.

More Repositories

1

blocks

TypeScript
238
star
2

airtable-ruby

Access Airtable data sheets with ease using ruby
Ruby
163
star
3

typescript-migration-codemod

The codemod Airtable used when migrating from Flow to TypeScript
TypeScript
98
star
4

airtable-gatsbyjs-blog

Example GatsbyJS blog using Airtable as a CMS
JavaScript
73
star
5

airtable_api_proxy

Example of proxying requests to Airtable
JavaScript
70
star
6

apps-base-schema

Visualize all your base’s tables, fields, and relationships.
JavaScript
26
star
7

apps-wikipedia-enrichment

Save text and images from Wikipedia to your base.
JavaScript
22
star
8

apps-todo-list

Mark records as complete with an interactive to-do list.
JavaScript
22
star
9

apps-update-records

Update cell values in the selected records.
JavaScript
20
star
10

apps-flowchart

Build a flowchart based on linked records.
JavaScript
19
star
11

apps-url-preview

Click a URL in a record to view its content in a block.
JavaScript
18
star
12

apps-print-records

Create a custom, printable layout from your records.
JavaScript
18
star
13

oauth-example

Example of integrating with Airtable via OAuth
JavaScript
11
star
14

apps-flashcard

Study records in your base with virtual flashcards.
JavaScript
10
star
15

apps-table-structure

Show the description and fields for the active table.
JavaScript
10
star
16

apps-hello-world

Start from scratch with a bare‑bones JavaScript block.
JavaScript
10
star
17

apps-json-editor

JavaScript
9
star
18

apps-vega-lite

Create visualizations using Vega-Lite inside your base
JavaScript
9
star
19

apps-hello-world-typescript

Start from scratch with a bare‑bones TypeScript block.
JavaScript
5
star
20

apps-summary

Summarize numerical data as averages, ranges, and more.
JavaScript
4
star
21

apps-shared-code

Shared code app examples
JavaScript
4
star
22

apps-simple-chart

Show a bar chart based on data from your table.
JavaScript
3
star
23

apps-name-quiz

Match the name to the picture in this mini-game.
JavaScript
2
star