Skip to content

fix: use public API URL for browser-injected WebSocket scripts (v0.1.36) - #488

Merged
kojiwakayama merged 2 commits into
mainfrom
fix/public-api-url-for-browser
Feb 28, 2026
Merged

kojiwakayama merged 2 commits into
mainfrom
fix/public-api-url-for-browser

Conversation

@kojiwakayama

Copy link
Copy Markdown
Contributor

Summary

  • getEnvironmentConfig().apiBaseUrl returns internal K8s URL (http://veryfront-api) in production, causing Mixed Content errors when injected into browser scripts
  • Add publicApiBaseUrl field to environment config that reads VERYFRONT_PUBLIC_API_URL env var, defaulting to https://api.veryfront.com
  • Use publicApiBaseUrl instead of apiBaseUrl for browser-injected WebSocket URLs
  • No K8s deployment changes needed — default is the correct public URL

Test plan

  • Open markdown file in Studio — WebSocket connects to wss://api.veryfront.com/api/ws/{projectId}/yjs (not internal K8s URL)
  • No Mixed Content errors in console
  • Yjs sync works correctly for collaborative editing

apiBaseUrl from environment config returns the internal K8s service URL
(http://veryfront-api) which is not reachable from the browser. Add
publicApiBaseUrl field that reads VERYFRONT_PUBLIC_API_URL env var,
defaulting to https://api.veryfront.com — the correct public endpoint.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 726a9065e2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/config/environment-config.ts Resolved
@kojiwakayama
kojiwakayama merged commit 28be71b into main Feb 28, 2026
11 checks passed
@kojiwakayama
kojiwakayama deleted the fix/public-api-url-for-browser branch February 28, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant