Skip to content

Not receiving incoming_typing_indicator push #147

Description

@orinciog

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions