Skip to content

NPM ​

Prerequisites ​

Before you get started, you need to:

Installation ​

Use your preferred package manager to install Honeypot:

sh
$ npm add @honeypot-run/core
sh
$ pnpm add @honeypot-run/core
sh
$ yarn add @honeypot-run/core

Importing ​

The next step is to import and initialize the Collector.

You will need to pass in the URL for your honeypot, which can be found on the

Honeypots page.
js
import { honeypot } from '@honeypot-run/core';

const url = 'https://<my-honeypot-url>/js'
honeypot.setup({ url })

Once you've initialized Honeypot using the code above, you're ready to track events.

Typescript support

We recommend utilizing TypeScript for improved developer experience and prevention of common errors.

The type definitions for the Honeypot SDKs are included with the library. For more information, review our TypeDocs documentation.