SinchClientListener | sinch-rtc
Description: Documentation for sinch-rtc

# Interface SinchClientListener

A `SinchClientListener` handles client state changes

interface SinchClientListener {
onClientFailed: (sinchClient: SinchClient, error: SinchError) => void;
onClientStarted: (sinchClient: SinchClient) => void;
onCredentialsRequired: (
sinchClient: SinchClient,
clientRegistration: ClientRegistration,
) => void;
}

##### Index

### Properties

onClientFailed
onClientStarted
onCredentialsRequired

## Properties

### onClientFailed

onClientFailed: (sinchClient: SinchClient, error: SinchError) => void

Tells the listener that there was an error in the SinchClient.

#### Type declaration

- - (sinchClient: SinchClient, error: SinchError): void

  - #### Parameters

    - sinchClient: SinchClient

      The SinchClient informing the listener that an error occurred.

    - error: SinchError

      SinchError object that describes the problem.

    #### Returns void

### onClientStarted

onClientStarted: (sinchClient: SinchClient) => void

Tells the listener that the client has started and ready for initiating outgoing calls. Note that in order to receive calls, SinchClient.setSupportManagedPush must be called.

#### Type declaration

- - (sinchClient: SinchClient): void

  - #### Parameters

    - sinchClient: SinchClient

      The client informing the listener that it started.

    #### Returns void

### onCredentialsRequired

onCredentialsRequired: (
sinchClient: SinchClient,
clientRegistration: ClientRegistration,
) => void

Tells the listener that registration credentials are needed.

#### Type declaration

- - (sinchClient: SinchClient, clientRegistration: ClientRegistration): void

  - #### Parameters

    - sinchClient: SinchClient

      The SinchClient informing the listener to register credentials

    - clientRegistration: ClientRegistration

      ClientRegistration object to call register on.

    #### Returns void