Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access the webchat state outside of the component #252

Open
khalo-sa opened this issue Jun 9, 2020 · 4 comments
Open

Access the webchat state outside of the component #252

khalo-sa opened this issue Jun 9, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@khalo-sa
Copy link

khalo-sa commented Jun 9, 2020

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!

@MatthieuJnon
Copy link
Contributor

Hi, unfortunately, we don't currently have a way to listen to messages sent from the user outside of the webchat. I'm going to add one to the prop onWidgetEvent though, I'll let you know here once it's done.

@MatthieuJnon MatthieuJnon added the enhancement New feature or request label Aug 3, 2020
@khalo-sa
Copy link
Author

khalo-sa commented Aug 3, 2020

@MatthieuJnon Amazing, thank you!

@khalo-sa
Copy link
Author

@MatthieuJnon Could you point me at the code changes necessary to implement that feature myself? I could create a PR in case I am successful.

@rajalala
Copy link

Hey any updates on this? ☺️
I have a use case where I'd love to be able to access user messages so either widget event or access to user_uttered socket event would be great! (As far as I understood, user_uttered socket event is not available on the React version?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants