diff --git a/.env.development b/.env.development index 40b221fe..d30eedef 100644 --- a/.env.development +++ b/.env.development @@ -18,4 +18,6 @@ VITE_DEFAULT_ENDORSER_API_SERVER=http://localhost:3000 VITE_DEFAULT_IMAGE_API_SERVER=https://test-image-api.timesafari.app VITE_DEFAULT_PARTNER_API_SERVER=http://localhost:3000 #VITE_DEFAULT_PUSH_SERVER... can't be set up with localhost domain +# Using shared test notify API (no local notify server by default). +VITE_DEFAULT_NOTIFY_API_SERVER=https://test-notify-api.timesafari.app VITE_PASSKEYS_ENABLED=true diff --git a/.env.production b/.env.production index aef4d6a4..2a92d953 100644 --- a/.env.production +++ b/.env.production @@ -11,3 +11,4 @@ VITE_DEFAULT_ENDORSER_API_SERVER=https://api.endorser.ch VITE_DEFAULT_IMAGE_API_SERVER=https://image-api.timesafari.app VITE_DEFAULT_PARTNER_API_SERVER=https://partner-api.endorser.ch VITE_DEFAULT_PUSH_SERVER=https://timesafari.app +VITE_DEFAULT_NOTIFY_API_SERVER=https://notify-api.timesafari.app diff --git a/.env.test b/.env.test index dd3d755c..19e23299 100644 --- a/.env.test +++ b/.env.test @@ -15,4 +15,5 @@ VITE_DEFAULT_ENDORSER_API_SERVER=https://test-api.endorser.ch VITE_DEFAULT_IMAGE_API_SERVER=https://test-image-api.timesafari.app VITE_DEFAULT_PARTNER_API_SERVER=https://test-partner-api.endorser.ch VITE_DEFAULT_PUSH_SERVER=https://test.timesafari.app +VITE_DEFAULT_NOTIFY_API_SERVER=https://test-notify-api.timesafari.app VITE_PASSKEYS_ENABLED=true diff --git a/src/constants/app.ts b/src/constants/app.ts index a309902b..020709fc 100644 --- a/src/constants/app.ts +++ b/src/constants/app.ts @@ -26,6 +26,9 @@ export enum AppString { TEST1_PUSH_SERVER = "https://test.timesafari.app", TEST2_PUSH_SERVER = "https://timesafari-pwa.anomalistlabs.com", + PROD_NOTIFY_API_SERVER = "https://notify-api.timesafari.app", + TEST_NOTIFY_API_SERVER = "https://test-notify-api.timesafari.app", + NO_CONTACT_NAME = "(no name)", } @@ -47,8 +50,6 @@ export const DEFAULT_PARTNER_API_SERVER = export const DEFAULT_PUSH_SERVER = import.meta.env.VITE_DEFAULT_PUSH_SERVER || AppString.PROD_PUSH_SERVER; -export const IMAGE_TYPE_PROFILE = "profile"; - /** * True when the current API server is not production (test/local build). * Use this to show dev/test-only UI (e.g. 10-minute rollover toggle, test user mnemonic). @@ -56,6 +57,27 @@ export const IMAGE_TYPE_PROFILE = "profile"; export function isNotProdServer(apiServer: string): boolean { return apiServer !== AppString.PROD_ENDORSER_API_SERVER; } + +/** + * Default Notification API base URL for the given Endorser API server. + * Prefers VITE_DEFAULT_NOTIFY_API_SERVER when set; otherwise prod vs test/local + * follows the same isNotProdServer logic used elsewhere. + */ +export function getDefaultNotifyApiServer(apiServer: string): string { + return ( + import.meta.env.VITE_DEFAULT_NOTIFY_API_SERVER || + (isNotProdServer(apiServer) + ? AppString.TEST_NOTIFY_API_SERVER + : AppString.PROD_NOTIFY_API_SERVER) + ); +} + +export const DEFAULT_NOTIFY_API_SERVER = getDefaultNotifyApiServer( + DEFAULT_ENDORSER_API_SERVER, +); + +export const IMAGE_TYPE_PROFILE = "profile"; + export const SUPPORT_EMAIL = "info@TimeSafari.app"; export const PASSKEYS_ENABLED =