1.0.6 • Published 4 years ago

@heartbeatgmbh/klick v1.0.6

Weekly downloads
3
License
MIT
Repository
gitlab
Last release
4 years ago

klick

An NPM Package for Heartbeat Klick

import Klick from "@heartbeatgmbh/klick"

Use the class

const klick = new Klick();

Tracking visited Objects:

klick.poi(123)

Integration

A few examples in how to use the Klick library for certain frameworks.

Nuxt.js

Create a new plugin for example plugins/klick.js:

import Klick from '@heartbeatgmbh/klick'

export default (context, inject) => {
  const klick = new Klick()
  if (!process.client) {
    // we need to set a default url for the ssr request which does not have an origin header
    klick.fallbackUrl = context.req.headers.referer
      ? context.req.headers.referer
      : context.req.headers.host
  }
  inject('klick', klick)
}

In order to work with ES6 Modules we need to add the library to the nuxt build transpiler in the nuxt.config.js file:

build: {
    transpile: [
        '@heartbeatgmbh/klick'
    ]
}

Now you are able to use this.$klick in the whole Nuxt.js application:

this.$klick.poi(1)

Internals

Best practive to publish new version of the library

  1. npm version patch -m 'fix class properties'
  2. git push
  3. npm publish
1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago