@knotel/intel

1.11.0 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @knotel/intel

Weekly Downloads

0

Version

1.11.0

License

MIT

Unpacked Size

2.21 kB

Total Files

2

Last publish

Collaborators

  • calebfaruki
  • lukechastain
  • jiverson-knotel