Hy!
Using Agent RTM I want to receive incoming_typing_indicator push.
I tried using both js libraries:
"@livechat/chat-sdk": "^0.2.0",
"@livechat/lc-sdk-js": "^5.4.0",
but is not working.
Code for @livechat/lc-sdk-js:
const { Agent } = require("@livechat/lc-sdk-js");
const { WebSocket } = require("ws");
const config = {
LIVECHAT_ACCESS_TOKEN:"",
LIVECHAT_ORGANIZATIONID:""
}
async initLivechat(){
const agentTokenGetter = () => ({
accessToken: config.LIVECHAT_ACCESS_TOKEN,
organizationID: config.LIVECHAT_ORGANIZATIONID,
region: "dal",
tokenType: "Bearer",
});
const agentRTM = new Agent.RTM(WebSocket, agentTokenGetter);
try {
await agentRTM.connect();
await agentRTM.login();
agentRTM.on("incoming_typing_indicator", (push) => {
console.log("Incoming typing indicator", push);
});
agentRTM.on("incoming_customer", (push) => {
console.log("incoming_customer ", push);
});
} catch (error) {
throw new Error(`Unable to initialize Agent RTM connection: ${JSON.stringify(error)}`);
}
}
initLivechat();
Code for @livechat/chat-sdk:
const ChatSDK = require("@livechat/chat-sdk");
const config = {
LIVECHAT_ACCESS_TOKEN:"",
LIVECHAT_ORGANIZATIONID:""
}
async initLivechatOld(){
const chat = new ChatSDK({ debug: true });
chat.init({
access_token: config.LIVECHAT_ACCESS_TOKEN
});
chat.on("incoming_typing_indicator", (event) => {
console.log("incoming_typing_indicator event", event);
});
chat.on("incoming_customer", (event) => {
console.log("incoming_customer event", event);
});
}
initLivechatOld();
Using both libs, I receive incoming_customer event, but I don't receive any incoming_typing_indicator. Is something that needs to be activated from your side per subscription?
Hy!
Using Agent RTM I want to receive
incoming_typing_indicatorpush.I tried using both js libraries:
but is not working.
Code for
@livechat/lc-sdk-js:Code for
@livechat/chat-sdk:Using both libs, I receive
incoming_customerevent, but I don't receive anyincoming_typing_indicator. Is something that needs to be activated from your side per subscription?