@botsquad/inbox-sdk
v0.2.0
Published
DialoX Inbox SDK
Downloads
5
Readme
Inbox SDK
Typescript SDK for the DialoX Inbox.
Usage
import { InboxSDK } from '@botsquad/inbox-sdk'
const options = {
iframeParent: document.getElementById('inbox-container'),
onIframeCreate: iframe => {
iframe.className = '...'
},
// Example languages: 'en', 'es', 'de', 'nl'
languageCode: 'en',
}
InboxSDK.authenticate(token, options).then(inbox => {
inbox.mine({
onSync(conversations) {
// Render conversations
},
})
inbox.operatorPresence.onSync(() => {
// Presence of fellow operators.
const operators = inbox.operatorPresence.list()
})
})