Skip to content

Update Endpoint configuration - #221

Merged
renal128 merged 1 commit into
nextfrom
add-conversation-endpoints
Aug 4, 2026
Merged

Update Endpoint configuration#221
renal128 merged 1 commit into
nextfrom
add-conversation-endpoints

Conversation

@renal128

@renal128 renal128 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

This is a step towards getting rid of global SDK config.

  • Add Endpoints on ConversationConfig: an apiBase for HTTP calls (the conversation token URL derives from it, there will be more endpoints using it later), plus explicit voice and text WebSocket URLs
  • Wire endpoints through DependenciesTokenService / WebSocketConnectionManager / WebRTCConnectionManager
  • Delete ConnectionConstants and remove apiEndpoint / websocketUrl from global ElevenLabs.Configuration (logging configure remains)
  • Simplify the API of TokenService - return just the token instead of a unnecessary wrapper.

Test plan

  • swift test

Stacked on #218.


Note

Medium Risk
Public API breaks for apps that customized endpoints via global ElevenLabs.Configuration; connection and token URLs now depend on per-session config, though production defaults match prior behavior.

Overview
Moves network targeting off global SDK config onto ConversationConfig.endpoints via a new Endpoints type (apiBase, voiceWebSocket, textWebSocket, defaulting to production). Token fetch, LiveKit voice connect, and text WebSocket URLs now read from that config through Dependencies, TokenService, WebRTCConnectionManager, and WebSocketConnectionManager.

ElevenLabs.Configuration no longer exposes apiEndpoint / websocketUrl (logging configure remains). ConnectionConstants is removed; the conversation token HTTP URL is derived from apiBase.

TokenService / TokenServicing are simplified: fetchToken(for:) returns a String instead of a ConnectionDetails bundle with server URL and empty room fields. ConversationClient builds Dependencies(endpoints: config.endpoints) when starting a session.

README adds a Custom Endpoints example; tests cover defaults, overrides, token URL derivation, and preserving existing query items on text WebSocket URLs.

Reviewed by Cursor Bugbot for commit 403fac6. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread Sources/ElevenLabs/Internal/Networking/WebSocketConnectionManager.swift Outdated
@renal128
renal128 force-pushed the add-conversation-endpoints branch from 4e03383 to f424281 Compare July 26, 2026 16:30
Comment thread Sources/ElevenLabs/Public/Authorization/TokenService.swift
@renal128
renal128 force-pushed the add-conversation-endpoints branch 2 times, most recently from 2562ec9 to 8ff5864 Compare July 26, 2026 16:59

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8ff5864. Configure here.

Comment thread Sources/ElevenLabs/Public/ElevenLabs/ElevenLabs+Configuration.swift
@renal128
renal128 force-pushed the add-conversation-endpoints branch from 8ff5864 to c7e0283 Compare July 26, 2026 17:09
@renal128 renal128 changed the title Make conversation endpoints configurable Update Endpoint configuration Jul 26, 2026
@renal128
renal128 force-pushed the add-conversation-endpoints branch from c7e0283 to 49d30e2 Compare August 4, 2026 15:47
@renal128
renal128 force-pushed the add-conversation-endpoints branch from 49d30e2 to 2b426ef Compare August 4, 2026 16:38
@renal128
renal128 force-pushed the add-conversation-endpoints branch from 2b426ef to 0ad421c Compare August 4, 2026 18:33
Base automatically changed from remove-feedback-availability-callback to next August 4, 2026 19:19
Add Endpoints on ConversationConfig and wire them through TokenService and the connection managers. HTTP requests derive from a single apiBase; ws/wss endpoints stay explicit. Drop ConnectionConstants and the global apiEndpoint/websocketUrl overrides.

Co-authored-by: Cursor <cursoragent@cursor.com>
@renal128
renal128 force-pushed the add-conversation-endpoints branch from 0ad421c to 403fac6 Compare August 4, 2026 19:23
@renal128
renal128 merged commit 2b6af38 into next Aug 4, 2026
2 checks passed
@renal128
renal128 deleted the add-conversation-endpoints branch August 4, 2026 19:30
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.

2 participants