How to use the airtable.base function in airtable

To help you get started, we’ve selected a few airtable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexanian / airtable-last-updated-hack / job.js View on Github external
var airtable = require('airtable');
var async = require('async');
var md5 = require('md5');
var moment = require('moment');
var fs = require('fs');
var configs = require('./configs');
var emailSender = require('./emailSender');
var secrets = require('./secrets');

// Set up connection to Airtable
airtable.configure({
    endpointUrl: 'https://api.airtable.com',
    apiKey: secrets.apiKey
});
var base = airtable.base(secrets.airtableBase);

// Create local storage for hashes of records
var hashDir = './localStorage/';
if (!fs.existsSync(hashDir)) {
    fs.mkdirSync(hashDir);
}

exports.hackLastUpdated = function hackLastUpdated() {
    // Each record that was updated will be included in email notifications
    var recordsUpdated = [];

    // Retrieve records from all tables listed
    async.forEach(configs.airtableTables, function(table, callback) {
        var hashPath = hashDir + table + '.json';
        var hashes = {};
github react-knowledgeable / rk-community-site / src / functions / airtable.js View on Github external
function _configureAirtable() {
  Airtable.configure({ apiKey: '__AIRTABLE_API_KEY__' });
  return Airtable.base('__AIRTABLE_BASE_ID__')('Attendees');
}
github victorhahn / airtable-plus / lib / AirtablePlus.js View on Github external
_mergeConfig(config) {
        if(!config) return this.config;
        let override = {};
        if(typeof config === "string") override.tableName = config;

        if(typeof config === "object") {
            if(typeof config.transform !== "function") config.transform = undefined;
            override = config;
        }

        let cfg = { ...this.config, ...override };

        if(cfg.apiKey !== Airtable.apiKey) {
            Airtable.apiKey = cfg.apiKey;
            cfg.base = Airtable.base(cfg.baseID);
        }

        if(!cfg.base || (cfg.baseID !== cfg.base.getId())) cfg.base = Airtable.base(cfg.baseID);

        return cfg;
    }
github victorhahn / airtable-plus / lib / AirtablePlus.js View on Github external
let override = {};
        if(typeof config === "string") override.tableName = config;

        if(typeof config === "object") {
            if(typeof config.transform !== "function") config.transform = undefined;
            override = config;
        }

        let cfg = { ...this.config, ...override };

        if(cfg.apiKey !== Airtable.apiKey) {
            Airtable.apiKey = cfg.apiKey;
            cfg.base = Airtable.base(cfg.baseID);
        }

        if(!cfg.base || (cfg.baseID !== cfg.base.getId())) cfg.base = Airtable.base(cfg.baseID);

        return cfg;
    }

airtable

The official Airtable JavaScript library.

MIT
Latest version published 1 year ago

Package Health Score

63 / 100
Full package analysis