Skip to main content

TypeScript vs Go

Use TypeScript for browser audio or embedding, and Go for terminal tools and services. Both render the same state model, but their defaults and delivery status differ. Go availability must be checked before using its examples.

AspectTypeScriptCurrent Go source
DistributionPublic npm packageCurrent API requires matching SDK/protocol source; public v0.1.0 is older
ControlgRPC-web Subscribe + unary SendConnect Subscribe + unary Send
AddressserverUrl, normally HTTPSAddr = host:port; constructs plain http://, no TLS option
Openconnect returns immediately and queues early intentsDial opens the subscription; doesn't await a cached snapshot; its context doesn't cancel the stream
Send resultMost commands return void; send_failed on onErrorMost commands return a send error
Auto-answertrue by defaultfalse by default
Answer policyOwn outbound ringing offer, excluding callbacksSame
Register argumentsDefaults to ["webrtc"]Variadic, no default; current server ignores capabilities in both cases
Current stateview, activeCall()View(), ActiveCall()
SubscribeImmediate cache callback, then updates; returns unsubscribeImmediate cache callback, then updates; no unsubscribe
Stream enddisconnected on thrown failure; clean end silentNo disconnect callback; closes media
RecoveryApplication owns reconnect and token renewalSame
NotificationsonNotification; see sequence caveatNo dedicated notification callback
Media defaultBrowser mic/speaker WebRTC; null disables mediaSynthetic WebRTC silence/RTP counts; nil selects this default
Media interfaceanswer, closeAnswer, Stats, Close
EnumsCallLifecycle.RINGINGCallLifecycle_CALL_LIFECYCLE_RINGING
Password helperOptional client ID; default managerFixed manager
PKCE helperspkceChallenge, buildAuthorizeUrl, authorizationCodeGrant (full response)GeneratePKCE, PkceAuthorizeURL, AuthorizationCodeGrant (access token only)
Revoke helperrevokeTokenRevokeToken, RevokeTokenClient
Cleanupawait close()Close() returns error; usually deferred
ConcurrencyEvent loop; keep callbacks shortSerialized sends; synchronize shared callback state

Registration loads data and requests reachability in both clients. A media-free observer and a silent-media client differ; neither should register without considering where calls will ring. See TypeScript control only and Go automation.

See also

Authentication owns endpoint and token details; Errors & reconnects explains lifecycle limits. For other languages, API surfaces distinguishes generated REST clients from clients that can consume live updates.