Skip to content

patrykomiotek/airtable-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Airtable proxy

It's a simple HTTP proxy for communicating with Airtable.

Alternative way is to create own endpoints and use Airtable.js

Setup

Create .env file with database credentials:

AIRTABLE_DATABASE_ID="YOUR_DATABASE_ID"
AIRTABLE_API_KEY="YOUR_API_KEY"

API key can be generated here.

Run

To launch application type:

yarn dev

or

npm dev

How proxy works?

Let's assume that you have Airtable account and database. Then all databases and auto-created documentation can be found at https://airtable.com/api

If you have table named offers in your database and view named default you can fetch records using below request:

curl "https://api.airtable.com/v0/YOUR_DATABASE_ID/offers?maxRecords=3&view=default" \
  -H "Authorization: Bearer YOUR_API_KEY"

This Airtable Proxy app allows you to automatically create url to the database (https://api.airtable.com/v0/YOUR_DATABASE_ID) and pass authorization header (Authorization: Bearer YOUR_API_KEY) using your credentials specified in .env file.

When you have an app running on port 3001, then instead of requesting Airtable explicitly you can pass your requests using /api endpoint:

http://localhost:3001/api/offers?maxRecords=3&view=default

which prevents to snoop your database credentials.

More advanced usage

The main (and only) goal of this app is to get a request and pass to Airtable. In more complex apps you can create your own endpoints to provide validation and use Airtable.js for manage your data.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published