For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReferenceClick-to-Call
GuidesReferenceClick-to-Call
  • Core
    • Overview
  • Entities
    • SignalWire
      • applySelectedAudioOutputDevice
      • audioInputDevices$
      • audioInputDisabled$
      • audioOutputDevices$
      • clearDeviceState
      • connect
      • destroy
      • destroyed$
      • deviceInfoToConstraints
      • deviceRecovered$
      • dial
      • directory$
      • disableAudioInput
      • disableDeviceMonitoring
      • disableVideoInput
      • disconnect
      • enableAudioInput
      • enableDeviceMonitoring
      • enableVideoInput
      • enumerateDevices
      • errors$
      • exportDiagnostics
      • getDeviceCapabilities
      • isConnected$
      • isRegistered$
      • isValidDevice
      • platformCapabilities
      • preflight
      • ready$
      • register
      • requestMediaPermissions
      • resetToDefaults
      • selectAudioInputDevice
      • selectAudioOutputDevice
      • selectedAudioInputDevice$
      • selectedAudioInputDeviceConstraints
      • selectedAudioOutputDevice$
      • selectedVideoInputDevice$
      • selectedVideoInputDeviceConstraints
      • selectVideoInputDevice
      • session
      • setStorageManager
      • unregister
      • user$
      • videoInputDevices$
      • videoInputDisabled$
      • warnings$
    • Address
    • Participant
    • ClientPreferences
    • SelfCapabilities
    • SelfParticipant
    • User
    • WebRTCCall
  • Web Components
    • Overview
    • sw-audio-level
    • sw-call-controls
    • sw-call-dialpad
    • sw-call-media
    • sw-call-provider
    • sw-call-status
    • sw-call-widget
    • sw-click-to-call
    • sw-device-selector
    • sw-directory
    • sw-local-camera
    • sw-participant-controls
    • sw-participants
    • sw-self-media
    • sw-ui-alert
    • sw-ui-background
    • sw-ui-call-layout
    • sw-ui-content-drawer
    • sw-ui-control-bar
    • sw-ui-dialpad
    • sw-ui-dropup
    • sw-ui-icon
    • sw-ui-modal
    • sw-ui-responsive-container
    • sw-ui-split-button
    • sw-ui-transcript-view
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Examples
  • Extends
  • Implements
  • Constructors
  • Constructor
  • Properties
  • Accessors
  • Methods
Entities

SignalWire

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

applySelectedAudioOutputDevice

Next
Built with

SignalWire is the top-level client for the Browser SDK and the only class applications instantiate directly. A single instance owns the WebSocket transport, the authenticated session, the local media-device controller, and the call factory used by dial. Every other entity in the SDK — WebRTCCall, User, Address — is produced or fetched through it.

Lifecycle: construct with a CredentialProvider, then await connection-readiness via ready$ or connect before placing or receiving calls. Calls to register opt the user into inbound calls; unregister reverses it. destroy tears down all transports, timers, and subscriptions — hold a reference to the client for the lifetime of your app and call destroy() exactly once on tear-down.

Device management methods (enable*, disable*, select*, applySelected*) operate on a shared device pool surfaced through observable accessors (audioInputDevices$, selectedVideoInputDevice$, etc.). Selections are persisted via the configured StorageManager when ClientPreferences.enableSavePreferences is set. Most state is exposed in two forms — a snapshot getter and an observable ($) for reactive UI binding.

Examples

1const client = new SignalWire(new StaticCredentialProvider({ token: 'YOUR_TOKEN' }));
2await client.connect();
3await client.register();
4client.errors$.subscribe(err => console.error(err));
5const call = await client.dial('/public/my-room', { audio: true, video: true });

Extends

  • Destroyable

Implements

  • DeviceController

Constructors

Constructor

1new SignalWire(credentialProvider, options?): SignalWire

Creates a new SignalWire client and begins connecting.

Parameters

credentialProvider
CredentialProvider | undefinedRequired

Provider that supplies authentication credentials. See CredentialProvider.

options
SignalWireOptions

Configuration options (connection, device monitoring, preferences). See SignalWireOptions.

Properties

preferences
ClientPreferencesRequired

Global SDK preferences (timeouts, ICE config, media defaults).

Accessors

audioInputDevices$

Observable list of available audio input (microphone) devices.

audioInputDisabled$

Observable that emits true when audio input is disabled (receive-only).

audioOutputDevices$

Observable list of available audio output (speaker) devices.

destroyed$

Observable that emits when the instance is destroyed

deviceRecovered$

Observable that emits when the SDK auto-switches a device.

directory$

Observable that emits the Directory instance once the client is connected, or undefined while disconnected.

errors$

Observable stream of errors from transport, authentication, and devices.

isConnected$

Observable that emits when the connection state changes.

isRegistered$

Observable that emits when the user registration state changes.

platformCapabilities

Platform WebRTC capabilities detected at construction time.

ready$

Observable that emits true when the client is both connected and authenticated.

selectedAudioInputDevice$

Observable of the currently selected audio input device.

selectedAudioInputDeviceConstraints

Media track constraints for the selected audio input device. Returns false when disabled.

selectedAudioOutputDevice$

Observable of the currently selected audio output device.

selectedVideoInputDevice$

Observable of the currently selected video input device.

selectedVideoInputDeviceConstraints

Media track constraints for the selected video input device. Returns false when disabled.

session

The underlying client session for advanced RPC operations.

user$

Observable that emits the User profile once fetched, or undefined before authentication completes.

videoInputDevices$

Observable list of available video input (camera) devices.

videoInputDisabled$

Observable that emits true when video input is disabled (receive-only).

warnings$

Observable stream of non-fatal SDK warnings (e.g. credential refresh fallback).

Methods

applySelectedAudioOutputDevice

Apply the currently selected audio output device to an HTMLMediaElement (e.g.

clearDeviceState

Clears all device state and re-enumerates.

connect

Establishes the WebSocket connection and authenticates the session.

destroy

Destroys the client, clearing timers and releasing all resources.

deviceInfoToConstraints

Converts a MediaDeviceInfo to track constraints suitable for getUserMedia.

dial

Places an outbound call to the given destination.

disableAudioInput

Disables audio input (receive-only mode). No audio track will be acquired.

disableDeviceMonitoring

Stops monitoring for media device changes.

disableVideoInput

Disables video input (receive-only mode). No video track will be acquired.

disconnect

Disconnects the WebSocket and tears down the current session.

enableAudioInput

Re-enables audio input, restoring the last selection or auto-selecting.

enableDeviceMonitoring

Starts monitoring for media device changes (connect/disconnect).

enableVideoInput

Re-enables video input, restoring the last selection or auto-selecting.

enumerateDevices

Forces a device re-enumeration.

exportDiagnostics

Export a structured diagnostic bundle for support/debugging. Includes connection events, call summaries, and device changes.

getDeviceCapabilities

Returns the capabilities of a media device.

isValidDevice

Checks whether a device is still available and usable.

preflight

Runs a multi-phase connectivity test against the given destination.

register

Registers the user as online to receive inbound calls and events.

requestMediaPermissions

Triggers the browser’s media permission dialog and captures the user’s device selections.

resetToDefaults

Clears all SDK-persisted state and resets to defaults.

selectAudioInputDevice

Sets the preferred audio input device.

selectAudioOutputDevice

Sets the preferred audio output device.

selectVideoInputDevice

Sets the preferred video input device.

setStorageManager

Injects a storage manager into the device controller for persistence.

unregister

Unregisters the user, going offline for inbound calls.