Skip to content

Access the webchat state outside of the component #252

Open
@khalo-sa

Description

@khalo-sa

Hey,
first of all let me thank you for open sourcing this great component, much appreciated!

I have kind of unusual use case for the webchat, and wasn't able to solve a problem related to the nature of this use case: I am trying to put a self developed "dashboard" component next to the webchat component. This dashboard is used to give the user of the webchat additional information beyond what is already replied by the bot and displayed in the webchat.
To make this work, I need to make an additional api call to my own backend server whenever the user sends a message via webchat.
Therefore, I think that somehow I need to register from outside of the webchat component that this event took place so that I can trigger that respective api call.
From what I read, React refs could be part of the solution, but besides that I am pretty clueless what to do...
Do you guys have an idea what is needed to make it work? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions