Skip to main content

Airtable Examples

const config = require('./config.js');
const airtable = require('airtable');

airtable.configure({
endpointUrl: 'https://api.airtable.com',
apiKey: config.airtable.apikey
});

const base = new airtable({ apiKey: config.airtable.apikey }).base('apppl7Nivyn1tO4Xv');

let record = {
id : '1',
userid: 'steve',
rating : 5,
would_recomend : true,
date : Date.now()
};

base('Ratings').create(record, function(err, record) {
if (err) { console.error(err); return; }
console.log(record.getId());
});