APIs & Integrations

sdash7
Participant

Integrating chat sdk to the Vuejs template

SOLVE

Hi all,

I am totally new to vuejs and hubspot. I want to integrate the conversation sdk to my template and I want to display the chatbox in all the templates/pages.

 

So far what I have done is:

I added my js script to the head in nuxt config.js file and added these function inside my middleware file.

```

if (window.HubSpotConversations) {
onConversationsAPIReady();
}
else {
window.hsConversationsOnReady = [onConversationsAPIReady];
}

function onConversationsAPIReady() {

window.hsConversationsSettings = {
loadImmediately: false,
identificationEmail: "xxxxx@gmail.com",
};
}

function loadChat() {
window.HubSpotConversations.widget.load();
}

```

 

When loading on the page, it says

```

this.onConversationsAPIReady is not a function

```

 

How to solve this and make it work properly.

 

Thank you

0 Upvotes
1 Accepted solution
tjoyce
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Integrating chat sdk to the Vuejs template

SOLVE

@sdash7 - I don't see where you're initializing the 

loadChat()

function... can you point that out?

View solution in original post

3 Replies 3
tjoyce
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Integrating chat sdk to the Vuejs template

SOLVE

@sdash7 - I don't see where you're initializing the 

loadChat()

function... can you point that out?

sdash7
Participant

Integrating chat sdk to the Vuejs template

SOLVE

Hi @tjoyce , @dennisedson thanks for the reply. it is solved now. 

dennisedson
HubSpot Product Team
HubSpot Product Team

Integrating chat sdk to the Vuejs template

SOLVE

@tjoyce , you have some advice for @sdash7 ?