From a8fe9c1d08dcbdbe080dbf550c67c44c939b815a Mon Sep 17 00:00:00 2001 From: Darnell Andries Date: Tue, 9 Jul 2024 14:24:50 -0700 Subject: [PATCH] Change development environment to point to premium staging --- src/services.ts | 5 +++++ src/subscriptions.ts | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/services.ts b/src/services.ts index 0dd08da5c..362d94839 100644 --- a/src/services.ts +++ b/src/services.ts @@ -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)}`; } diff --git a/src/subscriptions.ts b/src/subscriptions.ts index ed7ba0847..f7c32703b 100644 --- a/src/subscriptions.ts +++ b/src/subscriptions.ts @@ -13,7 +13,7 @@ const loadRewardsSdk = async (): Promise => { log(`calling initialize(${env}, false)...`); const sdk = await Rewards.initialize( - isDevelopment ? "development" : env, + isDevelopment ? "staging" : env, false, isProduction ? "error" : "info", ); @@ -73,7 +73,10 @@ export async function checkSubscribedUsingSDK(): Promise { 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;