Skip to main content

Configuration

Archived SDK documentation

This page preserves the previous SDK documentation and its existing URL. The generated API reference was produced from SDK 0.1.5, source commit 4db9fbe925bf07a4b95e936a5bb172d6ab5820bb. Handbook behavior and compatibility claims below are historical descriptions, not a newly verified support guarantee. For the reviewed version-specific reference, see the SDK 0.1.5 overview.

Pass an options object to the DelphiClient constructor:

import {DelphiClient} from '@ki-kombinat/delphi-client-js-sdk';

const delphi = new DelphiClient({
apiDomain: 'api.delphi.ki-kombinat.com',
apiKey: 'sk_live_…',
sessionTokenUrl: '/api/proxy/sessions/token',
runtimeCapabilitiesUrl: '/api/proxy/runtime/capabilities',
sessionIdleTimeoutMs: 300_000,
iceServers: [
{urls: 'stun:stun.example.com:3478'},
{urls: 'turn:turn.example.com:3478', username: 'u', credential: 'p'},
],
preferPcma: true,
logger: console,
});

Options​

OptionTypeDefaultNotes
apiDomainstring—TelAPI domain used to build REST and WebSocket URLs.
apiKeystring—API key for session-token requests. Optional if sessionTokenUrl proxies auth.
sessionTokenUrlstring—Same-origin proxy override for session-token requests. Use when the browser must not see the raw apiKey.
runtimeCapabilitiesUrlstring—Same-origin proxy override for /runtime/capabilities.
sessionIdleTimeoutMsnumber300_000Auto-close idle non-voice sessions. 0 disables. Voice sessions ignore this.
iceServersRTCIceServer[]derived from session tokenCustom WebRTC ICE servers. When omitted, the SDK derives them from telproDomain returned in the session-token response.
preferPcmabooleantruePrefer PCMA over Opus so the WebRTC gateway can skip transcoding.
loggerLoggerconsoleCustom logger with { debug, info, warn, error }.

Where the WebRTC gateway URL comes from​

There is no webrtcGatewayUrl SDK option. For voice calls, the WebRTC gateway WebSocket URL is returned per-session by your backend in the session-token response (SessionTokenResponse.webrtcGatewayUrl) alongside telproDomain. This lets the server route per session (region, A/B, swap implementations) without an SDK config push.

Production guidance

In production, keep apiKey server-side and front the SDK with sessionTokenUrl pointing at your backend proxy. The browser then never holds a long-lived credential.

Same-origin proxies​

Both sessionTokenUrl and runtimeCapabilitiesUrl accept absolute or same-origin paths. The expected response shapes are:

  • POST <sessionTokenUrl> → SessionTokenResponse (sessionId, wsToken, wsUrl, telproDomain, webrtcGatewayUrl).
  • GET <runtimeCapabilitiesUrl>?endpointId=<id> → the same EndpointCapabilities shape as delphi.getCapabilities(endpointId) returns.

A reference reverse-proxy lives in the platform's apps/portal package; see the platform docs for setup.

Next step​

Capabilities — how to discover what an endpoint supports before opening a session.