# use-ackee

> Use Ackee in React

Latest version **4.0.0** (published 2026-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-ackee
pnpm add use-ackee
yarn add use-ackee
bun add use-ackee
```

## Health

**Score 63/100 (C)** — status: active.

Positive: has types package; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2026-10-08 |
| First published | 2019-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/use-ackee) |
| Module format | CommonJS |
| Node | >=24.15.0 |
| Dependencies | 1 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Maintainers | electerious |
| Keywords | react, hooks, hook, tracker, analytics, tracking, ackee |

## Links

- npm: https://www.npmjs.com/package/use-ackee
- Repository: https://github.com/electerious/use-ackee
- Issues: https://github.com/electerious/use-ackee/issues
- npm.io page: https://npm.io/package/use-ackee

## Dependencies (1)

- [ackee-tracker](https://npm.io/package/ackee-tracker.md) ^5.1.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2026-10-08
- 3.1.0 — 2024-06-13
- 3.0.1 — 2022-01-09
- 3.0.0 — 2021-02-21
- 2.0.0 — 2021-01-24
- 1.0.0 — 2020-08-15
- 0.3.0 — 2020-05-26
- 0.2.0 — 2020-03-20
- 0.1.0 — 2019-11-10

## README

# use-ackee

![Test](https://github.com/electerious/use-ackee/actions/workflows/test.yml/badge.svg)

Use [Ackee](https://github.com/electerious/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.

```js
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](https://github.com/electerious/Ackee) installation. The `server` property must not end with a slash.
- `opts` `{?Object}` An object of [Ackee options](https://github.com/electerious/ackee-tracker#options).

---
_Source: https://npm.io/package/use-ackee · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
