Abdullah Zafar
Abdullah Zafar

Reputation: 187

Integrate frontchat with Nuxt

I am integrating the front app with my nuxt site. It's already working fine with my previous vue site. Add the bundle in the script tag of the nuxt.config.js file.

  head: {
   script: [{ src: 'https://chat-assets.frontapp.com/v1/chat.bundle.js' }]
  },

I am integrating the rest of the script in the Pages/index.vue file. Like that

if (process.client) {
  window.FrontChat('init', {
  chatId: 'XXXXXXXXXXXXXXX',
  useDefaultLauncher: true
});
}

Its giving me this warning & error. enter image description here

Upvotes: 0

Views: 86

Answers (1)

Abdullah Zafar
Abdullah Zafar

Reputation: 187

I resolved it by just adding body: true because the

Front Chat script should be positioned just before the closing body tag.

head: {
  script: [{ 
    src: 'https://chat-assets.frontapp.com/v1/chat.bundle.js' 
    body: true, 
  }]
},

Upvotes: 1

Related Questions