The user said they have inherited some old JS Genesys webchat code from developers who have since left the company and are still trying to understand its implementation. They believe the problem could be related to this SDK code:
The docs say, "If the namespace is not already taken, it will return a CXBus plugin interface object configured with the selected namespace. If the namespace is already taken, it will return false."
We currently don't have any checking to see if this line returns false. The next line we have is
customPlugin.command('WebChat.open', config);
And they are seeing a lot of error logs for their app saying that "customPlugin.command is not a function". I'm guessing it's because customPlugin is false.
It's difficult for us to test as this is in their production environment and they don't know how to reproduce it in our development environments to be sure this is the case.
The user wanted an explanation of what a "namespace" refers to and what we should be doing if CXBus.registerPlugin() returns false?
First, you'll need somewhere to test outside of your production environment. If you have a GitHub account then I'd suggest you create a simple HTML page that presents your "website" and host it on GitHub pages: https://pages.github.com/. Once you have a page then I'd suggest putting the Genesys Widget snippet into it so that you have a non-production way to test things.
When you embed the Genesys Widgets snippet into your page it create the Genesys namespace, named "window._genesys". This is a Javascript object defined off of the browser's window object that contains all of the Genesys Widget functionality. You can read about it here Widgets Bus API overview - Genesys Documentation and scroll down to "Global Access".
There is also a window.CXBus object that is exposed as well.
If CXBus.registerPlugin is return false or undefined then the most likely culprit is that you aren't including all of the proper references to the Genesys pieces in your tag as defined in the deployment guide: Genesys Widgets deployment guide - Genesys Documentation
If you need the original snippet to embed then use our Genesys Cloud WebChat Developer Tool to see the exact code you'd need to include for the Chat Widget you have defined in Admin->Widgets: https://developer.genesys.cloud/developer-tools/#/webchat (scroll to the bottom).