Ethora Community

Community › Developers (platform specific questions) › React.js (Web)

Addressing "useXmppClient must be used within a XmppProvider" issue in Ethora NPM Chat Component

Archived from the Ethora community forum. First posted on 9 December 2025; product details may have changed since. For current setup see Get Ethora and GitHub.

Q: I have downloaded the Ethora chat component package (https://www.npmjs.com/package/@ethora/chat-component) and am getting this error message:

useXmppClient must be used within a XmppProvider

A: For chat to start working you should wrap it with

<XmppProvider>

   {children} 

</XmppProvider>

You can either wrap the whole app (it is needed to perform logout properly and to show unread messages counter in the other parts of the app and etc), or just wrap the Chat Component itself for testing purposes.

Have a question about this? Ask the Ethora team.