Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 08dc444

Browse files
committed
add: protect env variable
1 parent ede925d commit 08dc444

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

@types/env.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '@env' {
2+
export const SUPABASE_URL: string;
3+
export const SUPABASE_KEY: string;
4+
}

babel.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
presets: ['module:metro-react-native-babel-preset'],
3+
plugins: [
4+
[
5+
'module:react-native-dotenv',
6+
{
7+
moduleName: '@env',
8+
path: '.env',
9+
blocklist: null,
10+
allowlist: null,
11+
safe: false,
12+
allowUndefined: true,
13+
verbose: false,
14+
},
15+
],
16+
],
17+
};

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
"expo-router": "4.0.20",
2121
"expo-splash-screen": "0.29.24",
2222
"expo-status-bar": "2.0.1",
23+
"metro-react-native-babel-preset": "^0.77.0",
2324
"react": "18.3.1",
2425
"react-dom": "18.3.1",
2526
"react-native": "0.76.9",
27+
"react-native-dotenv": "^3.4.11",
2628
"react-native-modal": "^14.0.0-rc.1",
2729
"react-native-reanimated": "3.16.1",
2830
"react-native-safe-area-context": "4.12.0",

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"strict": true,
55
"paths": {
66
"@/*": ["./src/*"]
7-
}
7+
},
8+
"typeRoots": ["./node_modules/@types", "./@types"]
89
},
910
"include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"]
1011
}

0 commit comments

Comments
 (0)