@edgedev/firebase 2.1.71 → 2.1.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/edgeFirebase.ts CHANGED
@@ -223,6 +223,7 @@ export const EdgeFirebase = class {
223
223
  },
224
224
  isPersistant: false,
225
225
  enablePopupRedirect: false,
226
+ functionsRegion = "us-central1",
226
227
  ) {
227
228
  this.firebaseConfig = firebaseConfig;
228
229
  this.app = initializeApp(this.firebaseConfig);
@@ -251,7 +252,7 @@ export const EdgeFirebase = class {
251
252
  if (this.firebaseConfig.storageBucket) {
252
253
  this.storage = getStorage(this.app);
253
254
  }
254
- this.functions = getFunctions(this.app);
255
+ this.functions = getFunctions(this.app, functionsRegion);
255
256
  if (this.firebaseConfig.emulatorFunctions) {
256
257
  connectFunctionsEmulator(this.functions, "127.0.0.1", this.firebaseConfig.emulatorFunctions)
257
258
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgedev/firebase",
3
- "version": "2.1.71",
3
+ "version": "2.1.74",
4
4
  "description": "Vue 3 / Nuxt 3 Plugin or Nuxt 3 plugin for firebase authentication and firestore.",
5
5
  "main": "index.ts",
6
6
  "scripts": {
package/src/.env.dev CHANGED
@@ -5,10 +5,11 @@ OPENAI_API_KEY=
5
5
  TWILIO_SID=
6
6
  TWILIO_AUTH_TOKEN=
7
7
  TWILIO_SYSTEM_NUMBER=
8
+
8
9
  FIREBASE_STORAGE_BUCKET=
9
10
  FIREBASE_STORAGE_BUCKET_REGION=
10
- FIREBASE_STORAGE_BUCKET=
11
- FIREBASE_STORAGE_BUCKET_REGION=
11
+ FIREBASE_STORE_REGION=us-west1
12
+
12
13
  CLOUDFLARE_R2_PUBLIC_URL=
13
14
  CLOUDFLARE_R2_ENDPOINT=
14
15
  CLOUDFLARE_R2_ACCESS_KEY_ID=
package/src/.env.prod CHANGED
@@ -5,10 +5,11 @@ OPENAI_API_KEY=
5
5
  TWILIO_SID=
6
6
  TWILIO_AUTH_TOKEN=
7
7
  TWILIO_SYSTEM_NUMBER=
8
+
8
9
  FIREBASE_STORAGE_BUCKET=
9
10
  FIREBASE_STORAGE_BUCKET_REGION=
10
- FIREBASE_STORAGE_BUCKET=
11
- FIREBASE_STORAGE_BUCKET_REGION=
11
+ FIREBASE_STORE_REGION=us-west1
12
+
12
13
  CLOUDFLARE_R2_PUBLIC_URL=
13
14
  CLOUDFLARE_R2_ENDPOINT=
14
15
  CLOUDFLARE_R2_ACCESS_KEY_ID=
package/src/config.js CHANGED
@@ -20,11 +20,16 @@ const {
20
20
  Change,
21
21
  FirestoreEvent,
22
22
  } = require('firebase-functions/v2/firestore')
23
- const { logger } = require('firebase-functions/v2')
23
+ const { logger, setGlobalOptions } = require('firebase-functions/v2')
24
24
  const { Firestore, getFirestore } = require('firebase-admin/firestore')
25
25
  const twilio = require('twilio')
26
26
  const db = getFirestore()
27
27
 
28
+ const defaultRegion = process.env.FIREBASE_STORE_REGION
29
+ || 'us-west1'
30
+
31
+ setGlobalOptions({ region: defaultRegion })
32
+
28
33
  // The permissionCheck function
29
34
 
30
35
  const permissions = {