Skip to content

fix(example): properly disconnect realtime session and support env API key#103

Merged
dore-decart merged 1 commit intomainfrom
fix/example-disconnect-and-env-api-key
Mar 23, 2026
Merged

fix(example): properly disconnect realtime session and support env API key#103
dore-decart merged 1 commit intomainfrom
fix/example-disconnect-and-env-api-key

Conversation

@dore-decart
Copy link
Copy Markdown
Contributor

@dore-decart dore-decart commented Mar 23, 2026

Summary

  • Fix disconnect bug: The disconnect button now calls decartRealtime.disconnect() to properly tear down WebRTC, WebSocket, and audio streams instead of just nulling the client reference
  • Pre-populate API key from env: The API key input is auto-filled from VITE_DECART_API_KEY environment variable when available

Test plan

  • Run pnpm build and pnpm dev:example
  • Set VITE_DECART_API_KEY env var and verify the input is pre-populated
  • Connect to a session, click Disconnect, and verify audio/video streams actually stop

🤖 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.html example’s runtime behavior and setup. The API key field is now auto-filled from import.meta.env.VITE_DECART_API_KEY when 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.

…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>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 23, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@decartai/sdk@103

commit: ef611e4

@dore-decart dore-decart merged commit ae9b2dc into main Mar 23, 2026
5 checks passed
@dore-decart dore-decart deleted the fix/example-disconnect-and-env-api-key branch March 23, 2026 09:55
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