Skip to content

Commit

Permalink
feat: airtable integration
Browse files Browse the repository at this point in the history
  • Loading branch information
betich committed Jun 16, 2024
1 parent 10467eb commit b2b6d16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"type": "module",
"version": "0.0.1",
"private": true,
"packageManager": "[email protected]",
"packageManager": "[email protected]",
"package-manager-strict": false,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand Down
6 changes: 3 additions & 3 deletions src/Handlers/airtable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Airtable from "airtable";

const apiKey = import.meta.env.AIRTABLE_API_KEY;
const apiPat = import.meta.env.AIRTABLE_API_PAT;

const airtableMock = (() => {
return {
Expand All @@ -10,8 +10,8 @@ const airtableMock = (() => {
}) as unknown as ReturnType<Airtable["base"]>;

export const base =
import.meta.env.MODE !== "development" || apiKey
? new Airtable({ apiKey: import.meta.env.AIRTABLE_API_KEY }).base(
import.meta.env.MODE !== "development" || apiPat
? new Airtable({ apiKey: import.meta.env.AIRTABLE_API_PAT }).base(
import.meta.env.AIRTABLE_BASE_ID
)
: airtableMock;

0 comments on commit b2b6d16

Please sign in to comment.