Skip to content

Comments

feat(realtime): add realtimeBaseUrl option to createDecartClient#91

Merged
AdirAmsalem merged 1 commit intomainfrom
opencode/calm-harbor
Feb 23, 2026
Merged

feat(realtime): add realtimeBaseUrl option to createDecartClient#91
AdirAmsalem merged 1 commit intomainfrom
opencode/calm-harbor

Conversation

@AdirAmsalem
Copy link
Contributor

@AdirAmsalem AdirAmsalem commented Feb 23, 2026

Summary

  • Adds a realtimeBaseUrl option to createDecartClient() to override the default wss://api3.decart.ai WebSocket base URL for realtime connections
  • Useful for self-hosted or custom deployments where the realtime endpoint differs from the default

Changes

  • packages/sdk/src/index.ts — Added realtimeBaseUrl to Zod schema, TypeScript types, JSDoc, error handling, and wiring to the realtime client
  • packages/sdk/tests/unit.test.ts — Added tests for invalid URL validation and custom URL creation
  • packages/sdk/index.html — Added optional "Realtime Base URL" input field to the test page
  • examples/sdk-core/realtime/custom-base-url.ts — New usage example
  • examples/sdk-core/README.md — Added example entry

Usage

const decart = createDecartClient({
  apiKey: "your-api-key",
  realtimeBaseUrl: "wss://custom-ws.example.com",
});

When realtimeBaseUrl is omitted, the default wss://api3.decart.ai is used (no breaking change).


Note

Low Risk
Additive configuration change with URL validation and tests; main risk is misconfiguration causing realtime connection failures.

Overview
Adds an optional realtimeBaseUrl to createDecartClient to override the default wss://api3.decart.ai used for realtime (WebRTC) connections.

Updates input validation/types/JSDoc and error handling to treat invalid realtimeBaseUrl like baseUrl, wires the value into realtime client creation, and adds unit tests. Also updates the SDK test index.html and examples/sdk-core with a new custom-base-url example and README entry showing how to configure it.

Written by Cursor Bugbot for commit 69f4aa8. This will update automatically on new commits. Configure here.

Allow overriding the default wss://api3.decart.ai WebSocket base URL
for realtime connections via a new realtimeBaseUrl option on
createDecartClient(). Useful for self-hosted or custom deployments.

- Add realtimeBaseUrl to Zod schema, TypeScript types, and JSDoc
- Wire through to realtime client with fallback to default URL
- Add validation error handling for invalid realtimeBaseUrl
- Add unit tests for invalid URL and custom URL scenarios
- Add realtimeBaseUrl input to test page (index.html)
- Add usage example (examples/sdk-core/realtime/custom-base-url.ts)
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 23, 2026

Open in StackBlitz

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

commit: 69f4aa8

Copy link
Contributor

@infoshoc infoshoc left a comment

Choose a reason for hiding this comment

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

thanks a lot!

@AdirAmsalem AdirAmsalem merged commit 2bad047 into main Feb 23, 2026
5 checks passed
@AdirAmsalem AdirAmsalem deleted the opencode/calm-harbor branch February 23, 2026 14:28
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