Back to guides

How to implement the widget with Nuxt.js application

Implementing UserWay Widget in a Nuxt.js Application

Follow these steps to implement the UserWay widget in a Nuxt.js application:

  1. Locate Nuxt Configuration File: Look for a file named nuxt.config.js.
  2. Add UserWay Script to Head: Add the script inside the head section as follows:

    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 UserWay Account ID: Change the value of the data-account attribute to your own account ID.
  4. Save and Test: Save the file and test the widget on your website.

If you require additional assistance, feel free to contact us at desk@support.userway.org.

Explore UserWay’s Accessibility Widget