Options
All
  • Public
  • Public/Protected
  • All
Menu

Unblu Visitor JS API

Index

Type aliases

AgentAvailabilityChangeListener

AgentAvailabilityChangeListener: (availability: AgentAvailabilityState) => void

Listener called whenever the agent availability state changes.

param

The new availability state.

Type declaration

AgentAvailableChangeListener

AgentAvailableChangeListener: (isAvailable: boolean) => void

Listener called whenever the agent availability changes.

param

A boolean that indicates if an agent is available.

Type declaration

    • (isAvailable: boolean): void
    • Parameters

      • isAvailable: boolean

      Returns void

CallStateListener

CallStateListener: (callState: CallState) => void

Type declaration

ConnectionStateListener

ConnectionStateListener: (connectionState: ConnectionState) => void

Type declaration

ConversationChangeListener

ConversationChangeListener: (conversation?: Conversation) => void

Listener called whenever the active conversation changes.

Note: If no conversation is currently active the passed conversation object will be null

param

API object for the active conversation or null if no conversation is active.

Type declaration

ConversationStateListener

ConversationStateListener: (conversationState: ConversationState) => void

Type declaration

ConversationsChangeListener

ConversationsChangeListener: (conversations: ConversationInfo[]) => void

Listener called whenever a conversation changed, added or removed from all conversations.

param

All conversations of the current visitor.

Type declaration

ErrorListener

ErrorListener: (e: Error) => void

Type declaration

    • (e: Error): void
    • Parameters

      • e: Error

      Returns void

InvitationsListener

InvitationsListener: (invitations: Invitation[]) => void

Type declaration

NewConversationInterceptor

NewConversationInterceptor: (conversationType: ConversationType, visitorData?: String) => Promise<String>

Interceptor function which is called every time a new conversation is started from the UI or JS API.

Starting the conversation is deferred until the Promise returned by this interceptor resolves: If the interceptor rejects the Promise, starting the conversation will be cancelled. If the interceptor resolves the Promise with a String, the value of the String will be used and set as "visitorData" for the conversation created. If the interceptor resolves the Promise without any value, or with something other than a String, the conversation will be started without any visitorData. If visitorData was passed to the startConversation, that data will be passed to this callback as its second argument.

param

The type of the conversation being started.

param

Optional visitorData, only present if passed to the startConversation method

returns

A Promise deferring the start of the conversation until it resolves.

Type declaration

    • Parameters

      Returns Promise<String>

NotificationCountChangeListener

NotificationCountChangeListener: (count: number) => void

Listener called whenever the notification count of a person (i.e. unread messages) changes.

param

The number of unseen notifications.

Type declaration

    • (count: number): void
    • Parameters

      • count: number

      Returns void

PersonChangeListener

PersonChangeListener: (person: PersonInfo) => void

Listener called whenever the local person changes.

param

Info about the person.

Type declaration

ReadyListener

ReadyListener: (api: UnbluApi) => void

Type declaration

UiStateChangeListener

UiStateChangeListener: (uistate: IndividualUiState) => void

Listener called whenever the UI state changes.

param

The new UI state.

Type declaration

Variables

Const unblu

unblu: Unblu = ...