@wisersolutions/heap-analytics

0.1.1 • Public • Published

heap-analytics

Utils for integrating Heap into web applications.

Use

To use Heap in a React application, simply use the useHeap hook in an app root with access to both the assigned Heap ID and to user information.

import { useHeap } from '@wisersolutions/heap-analytics'

export const App = ({ heapId, username, ...props }) => {
  useHeap(heapId, username)
  // … (render the app)
}

To integrate Heap into an app that's not using React, import just the loader code.

import '@wisersolutions/heap-analytics/lib/heap'

Development

Install

Install dependencies using:

npm install

Develop

After you modify sources, run the following (or set up your IDE to do it for you):

  • format the code using npm run format
  • lint it using npm run lint

and fix the errors, if there are any.

Publish

Publishing is done in two steps:

  1. Create a new version tag and push it to the repository:
    npm version <patch|minor|major>
    git push --follow-tags
  2. Build and publish the new version as a npm package:
    npm publish --access public

Readme

Keywords

none

Package Sidebar

Install

npm i @wisersolutions/heap-analytics

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

10.6 kB

Total Files

9

Last publish

Collaborators

  • mcarlotta
  • hon2a