Skip to content

Commit

Permalink
Define keys in build
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpigeon committed Feb 28, 2021
1 parent 4dc6fa0 commit 192b7f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 6 additions & 0 deletions configs/webpack.config.main.prod.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,18 @@ export default merge(baseConfig, {
*
* NODE_ENV should be production so that modules do not perform certain
* development checks
*
* The keys for emotiv SDK usage are piped into prod builds here via
* env variables set by secrets in Github Actions
*/
new webpack.EnvironmentPlugin({
NODE_ENV: 'production',
DEBUG_PROD: false,
START_MINIMIZED: false,
E2E_BUILD: false,
CLIENT_ID: process.env.CLIENT_ID,
CLIENT_SECRET: process.env.CLIENT_SECRET,
LICENSE_ID: process.env.LICENSE_ID,
}),
],

Expand Down
6 changes: 2 additions & 4 deletions keys.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// These values must be filled with the appropriate Emotiv credentials to be able to use the Cortex SDK
// We have our credentials stored in environement variables

const USERNAME = process.env.USERNAME;
const PASSWORD = process.env.PASSWORD;
const CLIENT_ID = process.env.CLIENT_ID; // Created through Cortex Apps page on Emotiv.com
const CLIENT_SECRET = process.env.CLIENT_SECRET; // Created through Cortex Apps page on Emotiv.com
const LICENSE_ID = process.env.LICENSE_ID; // Visible on My Account page of Emotiv.com

const envVars = { USERNAME, PASSWORD, CLIENT_ID, CLIENT_SECRET, LICENSE_ID };
const envVars = { CLIENT_ID, CLIENT_SECRET, LICENSE_ID };
Object.keys(envVars).forEach((k) =>
console.log(typeof envVars[k] === 'string')
);

module.exports = { USERNAME, PASSWORD, CLIENT_ID, CLIENT_SECRET, LICENSE_ID };
module.exports = { CLIENT_ID, CLIENT_SECRET, LICENSE_ID };
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "brainwaves",
"productName": "BrainWaves",
"version": "0.14.2",
"version": "0.15.0-rc3",
"description": "EEG Experiment Desktop Application",
"scripts": {
"build": "concurrently \"yarn build-main\" \"yarn build-renderer\"",
Expand Down

0 comments on commit 192b7f9

Please sign in to comment.