Skip to content
electeriousPublic

About

Use Ackee in React.

Resources

Stars

26 stars

Watchers

1 watching

Forks

Repository files navigation

use-ackee

Test

Use Ackee in React.

Install

Requires Node.js 24.15.0 or newer.

npm install use-ackee

or

yarn add use-ackee

Usage

Import and call use-ackee in a component responsible for the routing or inside your routes. Make sure that only one use-ackee hook is actively rendered to avoid redundant records.

useAckee(
  '/current/path',
  {
    server: 'https://example.com',
    domainId: 'hd11f820-68a1-11e6-8047-79c0c2d9bce0',
  },
  {
    detailed: false,
    ignoreLocalhost: true,
    ignoreOwnVisits: true,
  },
)

Ackee will create a new record every time the pathname changes. An undefined or empty pathname will be skipped. Use / for the root instead.

This hook is a no-op on the server for safe usage during server-side rendering.

API

Parameters

  • pathname {?String} Current path.
  • environment {Object} An object that contains details about your Ackee installation. The server property must not end with a slash.
  • opts {?Object} An object of Ackee options.

About

Use Ackee in React.

Resources

Stars

26 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages