This module wraps airtable in feathers common API to make it callable by frameworks such as React Admin.
This is currently Alpha.
- Multi option
- Allow Airtable specific whitelist calls
$ npm install --save feathers-airtable
Important:
feathers-airtable
implements the Feathers Common database adapter API and querying syntax.
Returns a new service instance initialized with the given options.
const service = require('feathers-airtable');
app.use('/my-table', service({
apiKey: '123123213'
baseId: '123123'
tableName: 'Table 1'
}));
app.use('/my-table', service({ apiKey, baseId, tableName }));
Options:
apiKey
(required) - Airtable API KeytableName
(required) - Name of your tablebaseId
(required) -(e.g. appAbba123456)
See the clients chapter for more information about using Feathers in the browser and React Native.
import feathers from '@feathersjs/feathers';
import airtable from 'feathers-airtable';
const app = feathers()
.use('/my-table', airtable({
apiKey: '123123213'
baseId: '123123'
tableName: 'Table 1'
}));
const myTable = app.service('my-table');
myTable.create({
text: 'Message from React Native'
});
I would strongly recommend not using this in the browser directly as Airtable API key grants full permissions!
To develop you need to do the following
- copy the .env.sample file into .env and
- Create a test Base and Table and fill in the values to match
- Run the test by doing
jest -i
orjest --watch -i
(i makes sure the tests are run sequentially) - The tests should clean up the records in the DB but if you get odd failing tests do to stray records while developing you can simply delete the records in the table.
- DON'T ever set to live data as it could be destructive.
Copyright (c) 2020
Licensed under the MIT license.