@umituz/react-native-firebase 2.4.49 → 2.4.51

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-firebase",
3
- "version": "2.4.49",
3
+ "version": "2.4.51",
4
4
  "description": "Unified Firebase package for React Native apps - Auth and Firestore services using Firebase JS SDK (no native modules).",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -119,15 +119,18 @@
119
119
  "README.md",
120
120
  "LICENSE"
121
121
  ],
122
+ "sideEffects": false,
122
123
  "exports": {
123
124
  ".": "./src/index.ts",
124
125
  "./auth": "./src/auth/index.ts",
125
126
  "./firestore": "./src/firestore/index.ts",
126
127
  "./storage": "./src/storage/index.ts",
128
+ "./init": "./src/init/index.ts",
127
129
  "./scripts": {
128
130
  "require": "./dist/scripts/index.js",
129
131
  "import": "./dist/scripts/index.js",
130
132
  "types": "./dist/scripts/index.d.ts"
131
- }
133
+ },
134
+ "./package.json": "./package.json"
132
135
  }
133
136
  }
@@ -37,7 +37,7 @@ function getEnvValue(key: ConfigKey): string {
37
37
  /**
38
38
  * Load configuration from expo-constants
39
39
  */
40
- function loadExpoConfig(): Record<string, string> {
40
+ function loadExpoConfig(): Record<string, unknown> {
41
41
  try {
42
42
  // eslint-disable-next-line @typescript-eslint/no-require-imports
43
43
  const Constants = require('expo-constants');
@@ -49,10 +49,13 @@ function loadExpoConfig(): Record<string, string> {
49
49
  }
50
50
 
51
51
  /**
52
- * Get config value from expo constants
52
+ * Get config value from expo constants.
53
+ * Supports two formats in app.json extra:
54
+ * 1. Flat: extra.firebaseApiKey (preferred)
55
+ * 2. Nested: extra.firebase.apiKey (legacy fallback)
53
56
  */
54
- function getExpoValue(key: ConfigKey, expoConfig: Record<string, string>): string {
55
- const mapping: Record<ConfigKey, string> = {
57
+ function getExpoValue(key: ConfigKey, expoConfig: Record<string, unknown>): string {
58
+ const flatMapping: Record<ConfigKey, string> = {
56
59
  apiKey: 'firebaseApiKey',
57
60
  authDomain: 'firebaseAuthDomain',
58
61
  projectId: 'firebaseProjectId',
@@ -60,7 +63,19 @@ function getExpoValue(key: ConfigKey, expoConfig: Record<string, string>): strin
60
63
  messagingSenderId: 'firebaseMessagingSenderId',
61
64
  appId: 'firebaseAppId',
62
65
  };
63
- return expoConfig[mapping[key]] || '';
66
+
67
+ // 1. Flat key: extra.firebaseApiKey
68
+ const flat = expoConfig[flatMapping[key]];
69
+ if (typeof flat === 'string' && flat) return flat;
70
+
71
+ // 2. Nested key: extra.firebase.apiKey
72
+ const nested = expoConfig['firebase'];
73
+ if (nested && typeof nested === 'object') {
74
+ const val = (nested as Record<string, unknown>)[key];
75
+ if (typeof val === 'string' && val) return val;
76
+ }
77
+
78
+ return '';
64
79
  }
65
80
 
66
81
  /**