How to implement the widget with Nuxt.js application

Rodrigo Asai
Rodrigo Asai
  • Updated

In order to implement the widget using an application with  Nuxt.js, please follow the steps: 

  1. Look for a file named  nuxt.config.js 
  2. Add the script inside thehead, as for e.g:

    Before:

    export default {
         // Global page headers: https://go.nuxtjs.dev/config-head
    head: {
       title: 'My Nuxt.js App',
       meta: [
          { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' },
          { hid: 'description', name: 'description', content: 'My awesome Nuxt.js app' }
        ],
        link: [
          { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
        ],

    After:

    export default {
         // Global page headers: https://go.nuxtjs.dev/config-head
    head: {
       title: 'My Nuxt.js App',
       meta: [
          { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' },
          { hid: 'description', name: 'description', content: 'My awesome Nuxt.js app' }
        ],
        link: [
          { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
        ],

        script: [
        { src: 'https://cdn.userway.org/widget.js', 'data-account': 'your ID'}
        ]
    },

  3. Modify the value of data-account attribute to your own account ID.
  4. Save the file and test the widget on your website.