Skip to content

Commit

Permalink
Update README.md with personal access token, OAuth and new docs links (
Browse files Browse the repository at this point in the history
…#329)

* Update `apiKey` documentation to mention personal access tokens and OAuth access tokens instead of API key
* Add link to the non-interactive API documentation
  • Loading branch information
minicat authored Nov 15, 2022
1 parent ccefdcc commit 560b466
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ See the [technical requirements](https://support.airtable.com/hc/en-us/articles/

There are three configurable options available:

* `apiKey` - set the token to your secret API token. Visit [your account page](https://airtable.com/account) to create an API token. (`AIRTABLE_API_KEY`)
* `apiKey` - your secret API token. Visit [/create/tokens](https://airtable.com/create/tokens) to create a personal access token. [OAuth access tokens](https://airtable.com/developers/web/guides/oauth-integrations) can also be used.
* `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`:

```js
Airtable.configure({ apiKey: 'YOUR_SECRET_API_KEY' })
Airtable.configure({ apiKey: 'YOUR_SECRET_API_TOKEN' })
```

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

```sh
export AIRTABLE_API_KEY=YOUR_SECRET_API_KEY
export AIRTABLE_API_KEY=YOUR_SECRET_API_TOKEN
```

You can also override the settings per connection:
Expand All @@ -72,6 +72,8 @@ const airtable = new Airtable({endpointUrl: 'https://api-airtable-com-8hw7i1oz63

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.

You can also view non-interactive API documentation at https://airtable.com/developers/web/api

# Promises

As of [v0.5.0](https://github.com/Airtable/airtable.js/releases/tag/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.
Expand Down

0 comments on commit 560b466

Please sign in to comment.