> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gleap.io/llms.txt
> Use this file to discover all available pages before exploring further.

# NodeJS

This package allows you to track server-side customer events.

## Installation

```bash theme={null}
npm install gleap-admin --save
```

## Usage

Import the GleapAdmin package.

```js theme={null}
import GleapAdmin from "gleap-admin";
```

### Initialize the SDK

It is required to initialize the GleapAdmin SDK before sending events or other requests.

```js theme={null}
GleapAdmin.initialize("secret-api-token");
```

The secret api token can be found within your project settings -> API.

### Track an event

```js theme={null}
GleapAdmin.trackEvent("user-id", "event-name", {
  someEventData: "yeah!",
});
```

The userId should match the userId you are using to identify your users.

The event data (last param) is optional.

### Identify an user

```js theme={null}
GleapAdmin.identify("user-id", {
  name: "XOXO",
  email: "asdf@asf.de",
  value: 1,
  phone: "+4395959595",
  customData: {
    plan: "Growth plan",
    company: "ACME inc.",
  },
});
```

The userId should match the userId you are using to identify your users.

All key-value pairs in the user properties part are optional.

## Rate limit

Please note that the identify and track APIs do enforce a rate limit of 1000 requests / 60 seconds for every project.
