@knotel/intel

React components for standardizing analytics implementation across Knotel apps

Usage no npm install needed!

<script type="module">
  import knotelIntel from 'https://cdn.skypack.dev/@knotel/intel';
</script>

README

@knotel/intel

React components for standardizing analytics implementation across Knotel apps

Install

yarn add @knotel/intel

Initializing Intel

In order to enable Heap Analytics in your app, you need to include the <IntelProvider /> component somewhere in your project, ideally in the root component. You must include both the environment you're running (local, test, stage, or prod), as well as your appName. These props are used to correctly place the events you're sending in Heap.

import React, { Component } from 'react'

import { IntelProvider } from '@knotel/intel'

class App extends Component {
  render () {
    return (
      <div>
        <IntelProvider environmnet="local" appName="atlas" />
        <MainPage />
      </div>
    )
  }
}

There is also a function getIntelContent that can be used to just get the script content, and just like IntelProvider, it accepts two arguments, environment and appName. This function can be used when an app uses something other than react-helmet to add tags to its head (for example, next.js uses its own Head component).

License

MIT © nicholasalanbrown 0