I’m trying to connect to the API with a private code playground such as Codepen for quick experimentation.
I’ve added the retrieve script to the JS editor:
var Airtable = require("airtable");
var base = new Airtable({ apiKey: "key123" }).base(
"app123"
);
base("Base").find("rece123", function (err, record) {
if (err) {
console.error(err);
return;
}
console.log("Retrieved", record.id);
});
But I get this error:
Uncaught ReferenceError: Airtable is not defined
I’ve tried linking to the Airtable CDN but that hasn’t worked. What else am I missing to get this to work? Is there a simple way to get Airtable running in a JS editor in the browser? It’s private so the API key is protected.
Here is a sample pen (not private with dummy key)
https://codepen.io/meowpower/pen/eYJNoXK?editors=0011
Thanks in advance
