Skip to content

fix(crm): resolve the CRM install URL at runtime - #288

Merged
chattermate merged 1 commit into
mainfrom
fix/crm-install-url-runtime
Aug 8, 2026
Merged

fix(crm): resolve the CRM install URL at runtime#288
chattermate merged 1 commit into
mainfrom
fix/crm-install-url-runtime

Conversation

@chattermate

@chattermate chattermate commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Fixes #287.

Connect on Pipedrive/HubSpot built its URL from import.meta.env.VITE_API_URL, which is baked at build time and never sees a self-hoster's window.APP_CONFIG. The browser left for the wrong host with no session cookie and got Not authenticated. Slack's install URL and the axios client already used getApiUrl() — this was the one spot that missed it.

Note: our images don't pass VITE_API_URL as a build arg, so in a repo-built image it's undefined, not the SaaS URL the reporter saw. Same fix either way.

The spec covers both CRM providers and Slack, so the class is guarded rather than the single line. Reverting the fix fails 7 of 10.

Two follow-ups left out to keep this tight: ShopifyAgentManagementView.vue has the same bug for avatar URLs (enterprise submodule, currently on an in-progress branch), and an ESLint rule could ban import.meta.env.VITE_API_URL outside config/api.ts.

The Connect button built its URL from import.meta.env.VITE_API_URL, which is
baked at build time and so never sees a self-hoster's window.APP_CONFIG. The
browser left for the wrong host — carrying no session cookie — and the install
died on "Not authenticated". Every sibling helper already used getApiUrl().

Adds a spec covering both CRM providers and the Slack install URL, so the whole
class of browser-navigation URL is guarded rather than just the one that broke.

Fixes #287

Signed-off-by: chattermate <admin@chattermate.chat>
@chattermate
chattermate merged commit f48ffc4 into main Aug 8, 2026
7 checks passed
@chattermate
chattermate deleted the fix/crm-install-url-runtime branch August 8, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant