Socket
Socket
Sign inDemoInstall

airtable

Package Overview
Dependencies
39
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    airtable

The awesome Airtable javascript library. It's official.


Version published
Weekly downloads
155K
decreased by-1.11%
Maintainers
1
Install size
2.89 MB
Created
Weekly downloads
 

Package description

What is airtable?

The airtable npm package allows you to interact with the Airtable API, enabling you to manage and manipulate data stored in Airtable bases. It provides a simple and intuitive interface for performing CRUD (Create, Read, Update, Delete) operations on Airtable records.

What are airtable's main functionalities?

Initialize Airtable

This code initializes the Airtable client with your API key and base ID, allowing you to interact with a specific Airtable base.

const Airtable = require('airtable');
const base = new Airtable({apiKey: 'YOUR_API_KEY'}).base('YOUR_BASE_ID');

Create a Record

This code creates a new record in the specified table with the given field values.

base('Table Name').create({
  'Field1': 'Value1',
  'Field2': 'Value2'
}, function(err, record) {
  if (err) {
    console.error(err);
    return;
  }
  console.log(record.getId());
});

Read Records

This code retrieves records from the specified table and logs the value of 'Field1' for each record.

base('Table Name').select({
  maxRecords: 3,
  view: 'Grid view'
}).eachPage(function page(records, fetchNextPage) {
  records.forEach(function(record) {
    console.log('Retrieved', record.get('Field1'));
  });
  fetchNextPage();
}, function done(err) {
  if (err) { console.error(err); return; }
});

Update a Record

This code updates a specific record in the table with a new value for 'Field1'.

base('Table Name').update('recXXXXXXXXXXXXXX', {
  'Field1': 'Updated Value'
}, function(err, record) {
  if (err) {
    console.error(err);
    return;
  }
  console.log(record.get('Field1'));
});

Delete a Record

This code deletes a specific record from the table.

base('Table Name').destroy('recXXXXXXXXXXXXXX', function(err, deletedRecord) {
  if (err) {
    console.error(err);
    return;
  }
  console.log('Deleted record', deletedRecord.id);
});

Other packages similar to airtable

Readme

Source

The awesome Airtable javascript library. It's official.

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 column IDs. In other words, Airtable API is your own RESTful API for your base.

We hope you find it fun and easy!

Configuration

There are two configurable options available:

  • apiKey - set the token to your secret API token. Visit your account page to create an API token. (AIRTABLE_API_KEY)
  • 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)

You can set the options globally via Airtable.configure:

Airtable.configure({ apiKey: 'YOUR_SECRET_API_KEY })

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

export AIRTABLE_API_KEY=YOUR_SECRET_API_KEY

You can also override the settings per connection:

var 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. It'll have examples for all operations you can perform against your bases.

What happened to the tests?

Don't worry, we have tests. Our tests live in a different repository and tests run on every git push. We strive to have all of the API covered along with all API error conditions. If you hit something that's not right, be sure to ping us on intercom or open a github issue.

Roadmap

Here's a few things that we'll expose in the API shortly:

  • Referencing records by name or some other field.
  • Transparently creating new multiple choice options when you update records.
  • Querying for recent changes
  • Receiving notifications about changed records

If you have a use case that needs something else, please reach out!

Keywords

FAQs

Last updated on 26 Jun 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc