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

How to configure widget link #215

Open
ConsulIam opened this issue Jul 20, 2024 · 6 comments
Open

How to configure widget link #215

ConsulIam opened this issue Jul 20, 2024 · 6 comments

Comments

@ConsulIam
Copy link

Hello everyone, I finally managed to run webwhiz. And now I'm having a difficult time.

How do I make the widget code take the URL I have configured? Always is generating the link with the url "https://widget.webwhiz.ai/?kbId=, where should I make this adjustment?

widget

@La100
Copy link

La100 commented Jul 26, 2024

Change it in Frontend/conatiners/EditChatbot

@ConsulIam
Copy link
Author

Hey @La100, thanks by your reply. I changed the widget url into the webwhiz/frontend/src/containers/EditChatbot/EditChatbot.tsx file.

Now when I generate the chatbot the URL is correct but the URL link don't show the chatbot. I'm reviewing the logs and I perceived the following:

?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:1 Uncaught TypeError: Cannot read properties of undefined (reading 'register')
    at HTMLDivElement.onreset (?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:1:56)
onreset @ ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:1Understand this error
pirsch.js:1 
        
        
       GET https://api.pirsch.io/hit?nc=1722117577576&code=VEW6587Xat8LXjE7ejokwXUked6s7udc&url=http%3A%2F%2Fwidget.chatautonomo.com%3A3031%2F%3FkbId%3D66a569cedb70a497e1f1b4f7%26embed%3Dtrue%26hide-chat-actions%3Dtrue&t=WebWhiz%20Live%20Chat&ref=&w=1920&h=1080 400 (Bad Request)
R @ pirsch.js:1
g @ pirsch.js:1
v @ pirsch.js:1
(anonymous) @ pirsch.js:1
(anonymous) @ pirsch.js:1
(anonymous) @ pirsch.js:1Understand this error
?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:160 
        
        
       GET https://api.webwhiz.ai/knowledgebase/66a569cedb70a497e1f1b4f7/chat_widget_data 404 (Not Found)
B @ ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:160
(anonymous) @ ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:218
(anonymous) @ ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:249Understand this error
?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:160 error
?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:218 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'chatWidgeData')
    at ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:218:1494
(anonymous) @ ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:218
await in (anonymous) (async)
(anonymous) @ ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:249Understand this error
?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:160 
        
        
       GET https://api.webwhiz.ai/chatbot/session//messages 404 (Not Found)
M @ ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:160
(anonymous) @ ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:160
setTimeout (async)
(anonymous) @ ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:160Understand this error
?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:160 Failed to fetch messages: Status 404
M @ ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:160
await in M (async)
(anonymous) @ ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:160
setTimeout (async)
(anonymous) @ ?kbId=66a569cedb70a497e1f1b4f7&embed=true&hide-chat-actions=true:160Understand this error
widget.chatautonomo.com/:1 Unchecked runtime.lastError: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received

Here is possible to see the chatbot is working
chat_working_try_chatbot

Here is possible to see the error returned.
error_chatbot

I really appreciate the support

@runephilosof-abtion
Copy link

pirsch.io is analytics. I have requested to have it turned off for self hosting #220

@runephilosof-abtion
Copy link

It is not finding the robot in the url https://api.webwhiz.ai/knowledgebase

If you are self hosting, it should not be using api.webwhiz.ai. You have it misconfigured.

@runephilosof-abtion
Copy link

You have it misconfigured.

My bad. It cannot be configured as far as I can tell.

As a workaround you can add &baseUrl=https://api.yourdomain to your widget url.

@hrithikt
Copy link
Collaborator

  • pirsch analytics have been removed from widget. so that won't cause issues in future. (0118c77)
  • you can now configure urls in the 'Add to site' section via env variables (053fb05)
    • update the REACT_APP_WEBWHIZ_WIDGET_URL variable in frontend/.env.docker to http://localhost:3031 or if you have deployed your app then use widget.yourdomain.
  • for your widget to work properly you have to also configure variables in widget (widget/.env.docker)
    • WW_WIDGET_URL='https://widget.yourdomain' ( or use http://localhost:3031 if you haven't deployed yet)
    • WW_BASE_URL='https://api.yourdomain' ( or use http://localhost:3000 if you haven't deployed yet)

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

No branches or pull requests

4 participants