OnCaller
  • OnCaller Developer Document
  • API
    • Authentication
    • Blacklist Number Management
    • Business Hour Management
    • Caller Setting
    • Call Actions
    • Call Logs
  • SDK
    • Javascript SDK
      • OnCallerCall
      • OnCallerCallState
      • OnCallerClient
      • OnCaller Error Code
      • Example
    • OnCaller Call Widget
    • Android SDK
    • iOS SDK
    • React Native SDK
    • Cordova/IONIC SDK
Powered by GitBook
On this page
  • Constructors
  • Properties
  • Methods
  • Events

Was this helpful?

  1. SDK
  2. Javascript SDK

OnCallerClient

PreviousOnCallerCallStateNextOnCaller Error Code

Last updated 4 years ago

Was this helpful?

Represents a OnCaller client. The first step in using OnCaller Javascript SDK is to initialize a OnCallerClient instance by calling the OnCallerClient() constructor. Then connects to OnCaller server by calling connect, pass in the access token. To generate access token, please follow this link:

You can use our latest SDK version at:

Constructors

OnCallerClient()

Creates a new OnCallerClient instance.

Properties

Properties

Description

accessToken

The access token generated by API

Methods

Method

Description

connect(accessToken)

Connects to OnCaller server, using provided access token.

disconnect()

Disconnects from OnCaller server.

sendCustomMessage(userId, data, callback)

Sends any data to other clients.

- userId: String - data: Object

Events

Event Name

Descriptions

connect

On connect to server

authen

On Authentication to server

disconnect

Disconnects from OnCaller server.

custommessage

On receive custom message from server

messagefromtopic

On message from topic

incomingcall

On incoming call

https://oncaller.asia/docs/#get-my-caller-access-token
https://cdn.oncaller.asia/assets/js/sdk/v1.0/oncaller.latest.sdk.bundle.min.js