• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Airtable/airtable.js: Airtable javascript client

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

Airtable/airtable.js

开源软件地址:

https://github.com/Airtable/airtable.js

开源编程语言:

JavaScript 85.4%

开源软件介绍:

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 airtable.browser.js which is in the build folder.

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 - 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)
  • 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_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. 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.

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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap