-
Notifications
You must be signed in to change notification settings - Fork 4
/
environment.example
95 lines (77 loc) · 2.45 KB
/
environment.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/** ***************************
* environment.js
* path: '/environment.js'
***************************** */
/* Modified from https://alxmrtnz.com/thoughts/2019/03/12/environment-variables-and-workflow-in-expo.html#comment-4589309119 */
/*
USAGE:
import getEnvVars from '../../environment';
*/
/*
Replace the following lines in `lib/airtable.js` (starting with this one)
const ENDPOINT_URL = 'https://api.airtable.com';
const { BASE_ID, AIRTABLE_API_KEY } = getEnvVars();
Airtable.configure({
endpointUrl: ENDPOINT_URL,
apiKey: AIRTABLE_API_KEY,
});
const base = Airtable.base(BASE_ID);
*/
import Constants from 'expo-constants';
const DEV_BASE_ID = 'appYfW7a2loPD26Vg';
const PROD_BASE_ID = 'app4fXK49bqcjDMEo';
const AIRTABLE_API_KEY = 'YOUR-API-KEY';
const HC_SECRET = 'HC_SECRET_FROM_HEROKU';
const prodFirebaseConfig = {
apiKey: 'AIzaSyBoE4ona7Ec_KIOxaETNCEJtuYZruU_FZg',
authDomain: 'quickstart-1587887313757.firebaseapp.com',
databaseURL: 'https://quickstart-1587887313757.firebaseio.com',
projectId: 'quickstart-1587887313757',
storageBucket: 'quickstart-1587887313757.appspot.com',
messagingSenderId: '683063775827',
appId: '1:683063775827:web:7ce28f91c45d6092cf6ca6',
measurementId: 'G-M5PXVWXBW0',
};
const devFirebaseConfig = {
apiKey: 'AIzaSyBjHTeYFCuZM7NcOD6z6_yPBWbAFDeieJo',
authDomain: 'healthy-corners.firebaseapp.com',
databaseURL: 'https://healthy-corners.firebaseio.com',
projectId: 'healthy-corners',
storageBucket: 'healthy-corners.appspot.com',
messagingSenderId: '861017041940',
appId: '1:861017041940:web:b9a10ef73bfb8b9c6ecb01',
measurementId: 'G-0584C2GYL5',
};
// For Sentry logging
const staticEnvVars = {
SENTRY_ORG: 'calblueprint',
SENTRY_PROJECT: 'dccentralkitchen',
SENTRY_AUTH_TOKEN: 'YOUR-SENTRY-AUTH-TOKEN',
};
const ENV_VARIABLES = {
dev: {
BASE_ID: DEV_BASE_ID,
AIRTABLE_API_KEY,
},
prod: {
BASE_ID: PROD_BASE_ID,
AIRTABLE_API_KEY,
},
};
// If releaseChannel not set, use process.env.NODE_ENV as substitute
const env =
Constants.manifest.releaseChannel || process.env.NODE_ENV === 'production'
? 'prod'
: 'dev';
const firebaseConfig = env === 'prod' ? prodFirebaseConfig : devFirebaseConfig;
const getEnvVars = () => {
if (__DEV__) {
return ENV_VARIABLES.dev;
}
if (env === 'prod') {
return ENV_VARIABLES.prod;
}
// Fall through to dev
return ENV_VARIABLES.dev;
};
export { getEnvVars as default, staticEnvVars, env, firebaseConfig, HC_SECRET };