fix(example): properly disconnect realtime session and support env API key#103
Merged
dore-decart merged 1 commit intomainfrom Mar 23, 2026
Merged
Conversation
…I key The disconnect button was not calling the SDK's disconnect method, leaving WebRTC, WebSocket, and audio streams active after clicking disconnect. Also pre-populate the API key input from VITE_DECART_API_KEY env variable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
YehoavR
approved these changes
Mar 23, 2026
commit: |
YehoavR
reviewed
Mar 23, 2026
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
decartRealtime.disconnect()to properly tear down WebRTC, WebSocket, and audio streams instead of just nulling the client referenceVITE_DECART_API_KEYenvironment variable when availableTest plan
pnpm buildandpnpm dev:exampleVITE_DECART_API_KEYenv var and verify the input is pre-populated🤖 Generated with Claude Code
Note
Low Risk
Low risk: changes are confined to the SDK example page, improving teardown and developer ergonomics without affecting production library logic.
Overview
Improves the
packages/sdk/index.htmlexample’s runtime behavior and setup. The API key field is now auto-filled fromimport.meta.env.VITE_DECART_API_KEYwhen present.The Disconnect button now calls
decartRealtime.disconnect()(instead of only clearing references) to properly tear down the realtime session before resetting local/remote media streams and UI state.Written by Cursor Bugbot for commit ef611e4. This will update automatically on new commits. Configure here.