Skip to content

Commit

Permalink
Change development environment to point to premium staging
Browse files Browse the repository at this point in the history
  • Loading branch information
DJAndries committed Jul 10, 2024
1 parent 9447363 commit a8fe9c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/services.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
export const env = process.env.ENVIRONMENT ?? "local";

export function resolveService(
servicePrefix: string,
baseHost: string = window.location.host,
): string {
if (env.startsWith("development") && servicePrefix === "account") {
return "https://account.bravesoftware.com";
}
return `https://${servicePrefix}.${secondLevelDomain(baseHost)}`;
}

Expand Down
7 changes: 5 additions & 2 deletions src/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const loadRewardsSdk = async (): Promise<Rewards.JSSDK> => {

log(`calling initialize(${env}, false)...`);
const sdk = await Rewards.initialize(
isDevelopment ? "development" : env,
isDevelopment ? "staging" : env,
false,
isProduction ? "error" : "info",
);
Expand Down Expand Up @@ -73,7 +73,10 @@ export async function checkSubscribedUsingSDK(): Promise<boolean> {
const sdk = await loadRewardsSdk();
log(`calling credential_summary...`);

const result = await sdk.credential_summary();
const credentialHostname = isDevelopment
? "talk.bravesoftware.com"
: undefined;
const result = await sdk.credential_summary(credentialHostname);
log("credential_summary returns", result);
if (result && result.active) {
return true;
Expand Down

0 comments on commit a8fe9c1

Please sign in to comment.