Skip to content

Commit

Permalink
chore: config via webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
esaminu committed Sep 21, 2023
1 parent a4c59e7 commit a379168
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 19 deletions.
36 changes: 18 additions & 18 deletions src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ export const networks: Record<NetworkId, Network> = {
nodeUrl: 'https://rpc.mainnet.near.org',
walletUrl: 'https://wallet.near.org',
helperUrl: 'https://helper.mainnet.near.org',
relayerUrl: process.env.RELAYER_URL || 'https://near-relayer-mainnet.api.pagoda.co/relay',
relayerUrl: process.env.RELAYER_URL,
explorerUrl: 'https://explorer.near.org',
fastAuth: {
mpcRecoveryUrl: 'https://mpc-recovery-leader-mainnet-cg7nolnlpa-ue.a.run.app',
authHelperUrl: 'https://api.kitwallet.app',
accountIdSuffix: 'near',
firebase: {
apiKey: process.env.FIREBASE_API_KEY || 'AIzaSyDhxTQVeoWdnbpYTocBAABbLULGf6H5khQ',
authDomain: process.env.FIREBASE_AUTH_DOMAIN || 'near-fastauth-prod.firebaseapp.com',
projectId: process.env.FIREBASE_PROJECT_ID || 'near-fastauth-prod',
storageBucket: process.env.FIREBASE_STORAGE_BUCKET || 'near-fastauth-prod.appspot.com',
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID || '829449955812',
appId: process.env.FIREBASE_APP_ID || '1:829449955812:web:532436aa35572be60abff1',
measurementId: process.env.FIREBASE_MEASUREMENT_ID || 'G-T2PPJ8QRYY',
apiKey: process.env.FIREBASE_API_KEY,
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
projectId: process.env.FIREBASE_PROJECT_ID,
storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.FIREBASE_APP_ID,
measurementId: process.env.FIREBASE_MEASUREMENT_ID,
},
},
},
Expand All @@ -30,20 +30,20 @@ export const networks: Record<NetworkId, Network> = {
nodeUrl: 'https://rpc.testnet.near.org',
walletUrl: 'https://wallet.testnet.near.org',
helperUrl: 'https://helper.testnet.near.org',
relayerUrl: process.env.RELAYER_URL_TESTNET || 'http://34.70.226.83:3030/relay',
relayerUrl: process.env.RELAYER_URL_TESTNET,
explorerUrl: 'https://explorer.testnet.near.org',
fastAuth: {
mpcRecoveryUrl: 'https://mpc-recovery-leader-testnet-cg7nolnlpa-ue.a.run.app',
authHelperUrl: 'https://testnet-api.kitwallet.app',
accountIdSuffix: 'testnet',
firebase: {
apiKey: process.env.FIREBASE_API_KEY_TESTNET || 'AIzaSyDAh6lSSkEbpRekkGYdDM5jazV6IQnIZFU',
authDomain: process.env.FIREBASE_AUTH_DOMAIN_TESTNET || 'pagoda-oboarding-dev.firebaseapp.com',
projectId: process.env.FIREBASE_PROJECT_ID_TESTNET || 'pagoda-oboarding-dev',
storageBucket: process.env.FIREBASE_STORAGE_BUCKET_TESTNET || 'pagoda-oboarding-dev.appspot.com',
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID_TESTNET || '116526963563',
appId: process.env.FIREBASE_APP_ID_TESTNET || '1:116526963563:web:053cb0c425bf514007ca2e',
measurementId: process.env.FIREBASE_MEASUREMENT_ID_TESTNET || 'G-HF2NBGE60S',
apiKey: process.env.FIREBASE_API_KEY_TESTNET,
authDomain: process.env.FIREBASE_AUTH_DOMAIN_TESTNET,
projectId: process.env.FIREBASE_PROJECT_ID_TESTNET,
storageBucket: process.env.FIREBASE_STORAGE_BUCKET_TESTNET,
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID_TESTNET,
appId: process.env.FIREBASE_APP_ID_TESTNET,
measurementId: process.env.FIREBASE_MEASUREMENT_ID_TESTNET,
},
},
},
Expand All @@ -57,6 +57,6 @@ export const networks: Record<NetworkId, Network> = {
// },
};

export const networkId: NetworkId = (process.env.NETWORK_ID as NetworkId) || 'mainnet';
export const networkId: NetworkId = (process.env.NETWORK_ID as NetworkId);
export const network = networks[networkId];
export const basePath = process.env.REACT_APP_BASE_PATH || '';
export const basePath = process.env.REACT_APP_BASE_PATH;
22 changes: 21 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,27 @@ module.exports = {
process: 'process/browser',
Buffer: ['buffer', 'Buffer']
}),
new webpack.EnvironmentPlugin({ DEBUG: true })
new webpack.EnvironmentPlugin({
DEBUG: true,
REACT_APP_BASE_PATH: '',
NETWORK_ID: 'mainnet',
RELAYER_URL: 'https://near-relayer-mainnet.api.pagoda.co/relay',
FIREBASE_API_KEY: 'AIzaSyDhxTQVeoWdnbpYTocBAABbLULGf6H5khQ',
FIREBASE_AUTH_DOMAIN: 'near-fastauth-prod.firebaseapp.com',
FIREBASE_PROJECT_ID: 'near-fastauth-prod',
FIREBASE_STORAGE_BUCKET: 'near-fastauth-prod.appspot.com',
FIREBASE_MESSAGING_SENDER_ID: '829449955812',
FIREBASE_APP_ID: '1:829449955812:web:532436aa35572be60abff1',
FIREBASE_MEASUREMENT_ID: 'G-T2PPJ8QRYY',
RELAYER_URL_TESTNET: 'http://34.70.226.83:3030/relay',
FIREBASE_API_KEY_TESTNET: 'AIzaSyDAh6lSSkEbpRekkGYdDM5jazV6IQnIZFU',
FIREBASE_AUTH_DOMAIN_TESTNET: 'pagoda-oboarding-dev.firebaseapp.com',
FIREBASE_PROJECT_ID_TESTNET: 'pagoda-oboarding-dev',
FIREBASE_STORAGE_BUCKET_TESTNET: 'pagoda-oboarding-dev.appspot.com',
FIREBASE_MESSAGING_SENDER_ID_TESTNET: '116526963563',
FIREBASE_APP_ID_TESTNET: '1:116526963563:web:053cb0c425bf514007ca2e',
FIREBASE_MEASUREMENT_ID_TESTNET: 'G-HF2NBGE60S'
})
],
devServer: {
static: {
Expand Down

0 comments on commit a379168

Please sign in to comment.