1.0.1 • Published 4 years ago

@ambitiondev/vue-cookiebot-plugin v1.0.1

Weekly downloads
211
License
MIT
Repository
github
Last release
4 years ago

Vue Cookiebot Plugin

version version

This vue plugin allows you to (dynamically) set up your Cookiebot implementation and load the consent banner and consent page on demand

Installation

  1. Install module: npm i @ambitiondev/vue-cookiebot-plugin --save or yarn add @ambitiondev/vue-cookiebot-plugin
  2. Go to the main JS-file of your Vue app and add the following:
  import Vue from 'vue'
  ...
  import VueCookieBot from '@ambitiondev/vue-cookiebot-plugin'

  Vue.use(VueCookieBot, {
    cookieBotID: 'insert your cookiebot ID here'
  })

  const app = new Vue({
    ...
  })
  1. The variable $cookiebot has been added to the Vue instance. You can trigger the consent banner where you'd like by executing:
  <script>
    export default {
      name: 'MyVueComponent',
      mounted () {
        this.$cookiebot.consentBanner()
      }
    }
  </script>

Documentation / API reference

For the full API reference regarding the Vue Plugin install method, see the Vue plugin install docs

For a list of available methods and properties on the $cookiebot instance, see the Vue plugin methods docs