Environment-dependent configuration (base URLs, feature endpoints, privacy/dashboard links, etc.) must be resolved from a single authoritative source and reused everywhere, instead of being hardcoded or re-derived in multiple places.
buildClineUrl(path)), so every link—dashboard, usage, credits, privacy settings, onboarding, etc.—consistently honors the configured environment (production, proxy, self-hosted). Replace any hardcoded production constants with calls to this helper; if the environment can’t be resolved, hide the affected UI rather than silently falling back to production.Example pattern:
// single source of truth, resolved once at startup
const appBaseUrl = await desktopClient.invoke<string>("get_cline_app_base_url");
// single builder used by every consumer
function buildClineUrl(path: string): string | undefined {
return appBaseUrl ? `${appBaseUrl}${path}` : undefined; // hide link if unresolved
}
const dashboardUrl = buildClineUrl("/dashboard");
const privacySettingsUrl = buildClineUrl(user?.dataPrivacyPath ?? "/privacy");
This keeps all environment-aware links consistent, avoids drift between hardcoded and dynamic URLs, and prevents unnecessary network calls or UI duplication.