Chat javascript-API

We`re using brightpattern as js-SDK(bpspat.api…)
How can we get access to chat\messages via js? We need to read message history, get internal user ids(like Telegram userid), send messages via js(like dialing with dialNumber).