Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Sep 08, 2018 03:40 PM
I’ve been working on a way to proxy Airtable API calls through a Cloudflare worker. What this library lets you do is add permissions and securely attach your API key to Airtable API requests without letting users see your credentials on the frontend.
Cloudflare Workers are $5/mo, and they run on Cloudflare’s edge network, so they’re really fast for clients. So this project is basically a serverless API proxy, and I’ve found it really useful for making the Airtable API client-side friendly.
Happy to answer questions about implementation or suggestions for improvements!
Oct 17, 2018 09:59 PM
This project sounds pretty fantastic. At the moment, my main need for a proxy is for caching and to avoid rate limit issues. Does this project address caching in any way?
Thanks,
Greg
Oct 18, 2018 04:38 AM
Unfortunately the first version does not add any form of caching. I have created an issue to add it now that Cloudflare Workers have access to cache storage.
Oct 18, 2018 03:38 PM
Karl,
Thanks for the reply. I’ll keep an eye out our giving adding some caching feature my self a try.
Thanks,
Greg
Feb 02, 2019 03:32 PM
Karl, do you have an idiot’s guide to get started. I know nothing about APIs or cloudflare at the moment and keen to use my own html forms with airtable without showing my key.
Thanks
Feb 03, 2019 05:37 PM
Unfortunately, you have to have a little bit of programming experience to use this library.
One simple solution that doesn’t involve code would be to use a form (like Wufoo or Google forms) hooked up to Zapier. Then, Zapier can be set up to save your data to Airtable.
Feb 03, 2019 11:46 PM
Hi Karl
I’d rather not use zapier.
I went on the GitHub page and seemed to have done everything right but when it comes to a uploading to cloudflare (not got an account yet) I get an error?
Feb 04, 2019 03:33 AM
What’s the error you see when you upload the code to Cloudflare?
Feb 04, 2019 05:48 AM
Hi Karl
So basically I have (Detailed explanation I know)
• Created a folder in my local drive called ‘Airtable’
• Downloaded the repo from github and added to the ‘Airtable’ folder
• I’ve then opened Terminal, cd’s into that folder and ran ‘npm install’
• Added my base ID and API key to ‘webpack.config.js’ to the following lines
airtableBaseId: JSON.stringify(process.env.AIRTABLE_API_BASE_ID || ‘appABC12345678’),
and
airtableApiKey: JSON.stringify(process.env.AIRTABLE_API_KEY || ‘keyABC12345678’),
• Then ran ‘npm run build’ in Terminal
• Opened Dist/worker.js in Sublime and copied the contents
• Finally went to https://cloudflareworkers.com and pasted my the contents in the left sidebar and clicked Update.
I then get the error: {“error”:“NOT_FOUND”}
Have I missed something or and I not using the cloudflare part correctly?
I’m ok with doing the html/css side of things but not so great with javascript/php side, I learn some and then forget more lol.
Thanks
Feb 05, 2019 10:48 AM
What url are you going to to see the error?
I think you have to go to a route with the name of the table in it to get results.