Integrating chat sdk to the Vuejs template

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

@tjoyce , you have some advice for @sdash7 ?

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

loadChat()

function… can you point that out?

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