fix: change SDK default WebSocket URL to production endpoint#3103
Open
sebuh-infsol wants to merge 1 commit into
Open
fix: change SDK default WebSocket URL to production endpoint#3103sebuh-infsol wants to merge 1 commit into
sebuh-infsol wants to merge 1 commit into
Conversation
The SDK AppSession was defaulting to ws://localhost:8002/app-ws (local dev server) instead of the production endpoint. This caused third-party apps to fail connecting with 'Connection timeout after 5000ms' errors when deployed outside the local dev environment. Changed default from ws://localhost:8002/app-ws to wss://api.mentra.glass/app-ws in: - cloud/packages/sdk/src/app/session/index.ts - cloud/docs/api-reference/websocket/app-connection.mdx - docs/app-devs/reference/app-session.mdx
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/app-devs/reference/app-session.mdx">
<violation number="1" location="docs/app-devs/reference/app-session.mdx:288">
P2: JSDoc comment for `mentraOSWebsocketUrl` is missing closing quote and `*/`, breaking the TypeScript interface example syntax</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| apiKey: string; | ||
|
|
||
| /** The WebSocket URL provided by MentraOS Cloud. Defaults to 'ws://localhost:8002/app-ws'. */ | ||
| /** The WebSocket URL provided by MentraOS Cloud. Defaults to 'wss://api.mentra.glass/app-ws. |
Contributor
There was a problem hiding this comment.
P2: JSDoc comment for mentraOSWebsocketUrl is missing closing quote and */, breaking the TypeScript interface example syntax
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/app-devs/reference/app-session.mdx, line 288:
<comment>JSDoc comment for `mentraOSWebsocketUrl` is missing closing quote and `*/`, breaking the TypeScript interface example syntax</comment>
<file context>
@@ -285,7 +285,7 @@ interface AppSessionConfig {
apiKey: string;
- /** The WebSocket URL provided by MentraOS Cloud. Defaults to 'ws://localhost:8002/app-ws'. */
+ /** The WebSocket URL provided by MentraOS Cloud. Defaults to 'wss://api.mentra.glass/app-ws.
mentraOSWebsocketUrl?: string;
</file context>
Suggested change
| /** The WebSocket URL provided by MentraOS Cloud. Defaults to 'wss://api.mentra.glass/app-ws. | |
| + /** The WebSocket URL provided by MentraOS Cloud. Defaults to 'wss://api.mentra.glass/app-ws'. */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The SDK
AppSessionwas defaulting tows://localhost:8002/app-ws(local dev server) instead of the production endpoint. This caused third-party apps to fail connecting with "Connection timeout after 5000ms" errors when deployed outside the local dev environment.Changes
Changed default from
ws://localhost:8002/app-wstowss://api.mentra.glass/app-wsin:cloud/packages/sdk/src/app/session/index.ts— SDK source codecloud/docs/api-reference/websocket/app-connection.mdx— API reference docsdocs/app-devs/reference/app-session.mdx— AppSession reference docsImpact
mentraOSWebsocketUrl: 'ws://localhost:8002/app-ws'in their app configTesting
Verified by deploying the camera app to SCARRED — sessions now connect successfully instead of timing out.
Note
Medium Risk
Changing the SDK default affects all apps that omit
mentraOSWebsocketUrl, so local workflows must override explicitly; connection behavior is core to app runtime.Overview
AppSessionnow defaultsmentraOSWebsocketUrltowss://api.mentra.glass/app-wsinstead ofws://localhost:8002/app-ws, so deployed third-party apps connect to production MentraOS Cloud without setting the URL explicitly. Local dev can still override with the localhost endpoint.Docs are aligned: the app WebSocket API reference renames the local tab to Local Development, and the
AppSessionConfigreference documents the new production default.Reviewed by Cursor Bugbot for commit 93fc6b0. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Set the SDK
AppSessiondefault WebSocket towss://api.mentra.glass/app-wsto prevent connection timeouts in deployed apps. Local dev can still override withmentraOSWebsocketUrl: 'ws://localhost:8002/app-ws'.cloud/packages/sdk/src/app/session/index.ts.cloud/docs/api-reference/websocket/app-connection.mdxanddocs/app-devs/reference/app-session.mdx.Written for commit 93fc6b0. Summary will update on new commits.