Skip to content

Commit 8fff783

Browse files
authored
Merge pull request #1775 from cprussin/only-require-walletconnect-id-in-prod
fix(api-refernece) only require WALLETCONNECT_PROJECT_ID in prod
2 parents a6cfd56 + 175d1c6 commit 8fff783

File tree

2 files changed

+3
-34
lines changed

2 files changed

+3
-34
lines changed

apps/api-reference/src/components/EvmProvider/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { metadata } from "../../metadata";
1111

1212
type EvmProviderProps = {
1313
children: ReactNode;
14-
walletConnectProjectId: string;
14+
walletConnectProjectId?: string | undefined;
1515
};
1616

1717
export const EvmProvider = ({
@@ -28,11 +28,11 @@ export const EvmProvider = ({
2828
[arbitrum.id]: http(),
2929
[sepolia.id]: http(),
3030
},
31-
walletConnectProjectId,
3231
appName: metadata.applicationName,
3332
appDescription: metadata.description,
3433
appUrl: metadata.metadataBase.toString(),
3534
appIcon: metadata.icons.apple.url,
35+
walletConnectProjectId: walletConnectProjectId ?? "",
3636
}),
3737
)}
3838
>

apps/api-reference/src/server-config.ts

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,6 @@ const demand = (key: string): string => {
1616
}
1717
};
1818

19-
/**
20-
* Indicates that we're running in a github actions workflow.
21-
*/
22-
export const IS_GITHUB_ACTIONS = process.env.GITHUB_ACTIONS === "true";
23-
24-
/**
25-
* Throw if the env var `key` is not set, unless we're running in github
26-
* actions. If running in GHA, then allow the variable to be unset and return
27-
* an empty string if so.
28-
*
29-
* This is useful because for some variables, we want an invariant that the
30-
* value is always present. However, we don't necessarily need the value just
31-
* to run code checks, some of which require a build, we don't want to
32-
* expose the secret to GHA unnecessarily, and we don't want to have to.
33-
*
34-
* So, in effect, variables marked with this will be asserted to be present in
35-
* Vercel or in local dev, and will type check as `string`, but will not throw
36-
* when running code checks in GHA.
37-
*
38-
* Note we use `IS_GITHUB_ACTIONS` and not e.g. `process.env.CI` here because
39-
* both Vercel and Github Actions set `process.env.CI`, and we specifically want
40-
* to only allow these variables to be nonpresent only if running a build just
41-
* for running code checks. Any build that will actually serve traffic must
42-
* have these variables set. Github Actions is the only environment that is
43-
* exclusively used for running checks, so semantically this is correct, but
44-
* this would need to be updated if we change infrastructure.
45-
*/
46-
const demandExceptGHA = IS_GITHUB_ACTIONS
47-
? (key: string) => process.env[key] ?? ""
48-
: demand;
49-
5019
/**
5120
* Indicates that this server is the live customer-facing production server.
5221
*/
@@ -62,6 +31,6 @@ const demandInProduction = IS_PRODUCTION_SERVER
6231

6332
export const GOOGLE_ANALYTICS_ID = demandInProduction("GOOGLE_ANALYTICS_ID");
6433
export const AMPLITUDE_API_KEY = demandInProduction("AMPLITUDE_API_KEY");
65-
export const WALLETCONNECT_PROJECT_ID = demandExceptGHA(
34+
export const WALLETCONNECT_PROJECT_ID = demandInProduction(
6635
"WALLETCONNECT_PROJECT_ID",
6736
);

0 commit comments

Comments
 (0)