Skip to content

Commit

Permalink
test env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum committed Mar 14, 2024
1 parent c9a6257 commit 5f5473e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/chromatic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ jobs:
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: packages/react-kit
INFURA_PROJECT_SECRET: ${{ secrets.INFURA_PROJECT_SECRET }}
REACT_APP_MAGIC_API_KEY: ${{ secrets.REACT_APP_MAGIC_API_KEY }}
7 changes: 6 additions & 1 deletion packages/react-kit/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ const config: StorybookConfig = {
});
config.plugins = config.plugins?.filter((plugin) => !!plugin);
return config;
}
},
env: (config) => ({
...config,
REACT_APP_MAGIC_API_KEY: process.env.REACT_APP_MAGIC_API_KEY || "REACT_APP_MAGIC_API_KEY_NOT_SET",
INFURA_PROJECT_SECRET: process.env.INFURA_PROJECT_SECRET || "INFURA_PROJECT_SECRET_NOT_SET",
}),
};
export default config;
5 changes: 3 additions & 2 deletions packages/react-kit/src/lib/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { getRpcUrls } from "../const/networks";

const magicLinkKey = process.env.REACT_APP_MAGIC_API_KEY;
const magicLinkKey =
process.env.REACT_APP_MAGIC_API_KEY || "REACT_APP_MAGIC_API_KEY";
if (!magicLinkKey) {
throw new Error("REACT_APP_MAGIC_API_KEY is not defined");
}
const infuraKey = process.env.INFURA_PROJECT_SECRET;
const infuraKey = process.env.INFURA_PROJECT_SECRET || "INFURA_PROJECT_SECRET";
if (!infuraKey) {
throw new Error("INFURA_PROJECT_SECRET is not defined");
}
Expand Down

0 comments on commit 5f5473e

Please sign in to comment.