Forum Academy Marketplace Showcase Pricing Features

I need help with a JavaScript API script

Has anyone ever used jivochat on the bubble?

I’m trying to pass the user data along with the chat widget built into the page.

The service provides the script to add a chat to the page. It works well when added to an HTML element or in the page header.
<script src="//code-sa1.jivosite.com/widget/JFLPAPLcOJ" async></script>

I have no knowledge of Javascript to add the name and email parameters of the user logged in with the script. According to information from the API documentation, this is perfectly possible.

jivo_api.setContactInfo({
"name": "John Smith",
"email": "[email protected]",
"phone": "+14084987855",
"description": "Description text"
});

Can someone help me create this script?

Here is the API documentation: JivoChat Developers API

Use Toolbox plugin to run this js script OR just use html element for your case.

Yes, but what about the correct structure of the script?
Attach the supplied with additional information

I managed to make it work I’ll leave it to whoever can be useful.

The correct code was like this:

<script>
function jivo_onOpen(res) {
 jivo_api.setContactInfo({
    "name": "John Smith",
    "email": "[email protected]",
    "phone": "+14084987855",
    "description": "Description text"
 }); 
 }
</script>

Plus the default script