createClient

Node SDK

Instantiate the instance with clientId & clientSecret.

createClient
Parameters
params (Object)
Name Description
params.clientId string Private project key / Account client ID. If Private project key is used then client_secret is mandatory. If account client ID is used then email and password are mandatory.
params.baseUrl string URL of the server to be used.
params.clientSecret string? Private project secret
params.email string? Account login email.
params.password string? Account login password.
Example
const client = createClient({
  clientId: '<private project key>',
  clientSecret: '<private project secret>',
  baseUrl: '<base url>'
})

or

const client = createClient({
   clientId: '<account client ID>',
   email: '<account email>',
   password: '<account password>',
   baseUrl: '<base url>'
})

Conversation

CPaaS conversation.

Conversation
Static Members
createMessage(params)
getMessages(params)
getStatus(params)
getMessagesInThread(params)
deleteMessage(params)
getSubscriptions(params)
getSubscription(params)
subscribe(params)
unsubscribe(params)

Notification

CPaaS notification helper methods

Notification
Static Members
parse(notification)

Twofactor

CPaaS provides Authentication API where a two-factor authentication (2FA) flow can be implemented by using that.

Twofactor
Static Members
sendCode(params)
verifyCode(params)
resendCode(params)
deleteCode(params)