event.helper.getData() returns undefined for conversation.onPrivateNoteClick in Freshchat SDK

Hi everyone,

I’m building a Freshchat custom app and trying to capture the following events using the Freshchat Frontend SDK:

  • conversation.onPrivateNoteClick

  • conversation.onSendClick

Here’s the issue I’m facing:
When I try to access the event data using event.helper.getData()It returns undefined.

However,event.helper.getData() returns undefined.
I was expecting to receive the private note or message details when an agent clicks on a note or sends a message inside the conversation view.

When I log the event.helper.getData():

Data is always undefined.
I really appreciate any help you can provide. Any guidance or working examples would be really helpful!

Hi @TAMIL ,

This is an expected behavior for the event type ‘click’. Please refer to the documentation. Click events occur when an agent clicks a button or link on the page. The event.helper.getData() method returns an empty JSON for most of these events, the only exception being timer events.

In this case, please use the available Intercept events methods:

  • conversation.onSendMessage - When message send is initiated

  • conversation.onResolveClick - When the resolve button is clicked

  • conversation.onReopenClick - When the reopen button is clicked

  • chatConversation.onSendMessage - When the agent clicks the Send button

Thanks,
Debjani

Hi @Debjani

I can get data using conversation.onSendMessage, but
The event only triggers when I click the send button. However, the message does not get added to the conversation reply.

If I remove conversation.onSendMessageI can post the message.
But when I use conversation.onSendMessageI get the data, yet the message does not get sent.

My code:

After clicking send button the reply "my web reply" not add the conversation


For example, after clicking the send button, the reply “my web reply” is not added to the conversation. In other words, conversation.onSendMessage allows me to intercept and read the message data, but it seems to block the message from being posted automatically.

Hi @Debjani,

Just following up on my earlier post — I was able to confirm that conversation.onSendMessage fires correctly when I click the send button, and I can log the message data.

However, the issue persists: the message doesn’t appear in the conversation once onSendMessage is active. It seems that the handler might be intercepting the event and preventing the default send behavior.

Hi @debjani,

Just following up on my earlier note — I was able to confirm that conversation.onSendMessage fires correctly when I click the Send button, and I can log the message data as expected.

However, the issue still persists: the message doesn’t appear in the conversation once onSendMessage is active. It seems like the handler might be intercepting the event and preventing the default send behavior.

Could you please confirm if this is the expected behavior, or if there’s a recommended way to allow the message to send while still using the event handler?