straas-message-sdk
v1.7.7
Published
Straas message sdk for node.js server.
Downloads
11
Keywords
Readme
Straas message sdk for server side
How to use StraaS message sdk
Expected you are prepared node@^6
, and run below
npm install straas-message-sdk
Then you can use createMessageManager
to create sdk instance and use api
import createMessageManager from 'straas-message-sdk'
const messageManager = createMessageManager({
accountId: <account_id provided from StraaS>,
memberToken: <member jwt by StraaS CMS of your memeber, use null for guest>,
})
messageManager.init()
.then(function() {
messageManager.connect(<chatroomName provided by StraaS>, {
events: {
aggregated_data_add: (msg) => {},
raw_data_add: (msg) => {},
...
},
})
}