Skip to content

Commit

Permalink
Don't pass an empty config, pass nothing (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
eltoder authored Nov 26, 2024
1 parent 4217af6 commit f1e5e0a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import * as functions from "firebase-functions";
import * as admin from "firebase-admin";
admin.initializeApp(

if (process.env.FUNCTIONS_EMULATOR) {
// We don't pass any configs, so admin SDK queries firebase API to get them.
// This works if the user is logged in and has access, but we don't want to
// require this for local development. Passing just the databaseURL seems to
// be enough. The default db name is just "setwithforks-dev". Once we have
// prod set up, we can rename the dev db and remove this code.
process.env.FUNCTIONS_EMULATOR
? { databaseURL: "https://setwithforks-dev-default-rtdb.firebaseio.com" }
: {}
);
admin.initializeApp({
databaseURL: "https://setwithforks-dev-default-rtdb.firebaseio.com",
});
} else {
admin.initializeApp();
}

import Stripe from "stripe";
const stripe = !functions.config().stripe
Expand Down

0 comments on commit f1e5e0a

Please sign in to comment.