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

# Core Features

> Identify users and track events with the Node.js SDK.

The Node.js SDK uses an **object-parameter** API. Methods return `void`; use callbacks or emitter events for completion. Every event must include at least one of `userId` or `anonymousId`.

### User identification

```javascript theme={null}
analytics.identify({
  userId: 'user@example.com',
  traits: {
    first_name: 'John',
    last_name: 'Doe',
    email: 'user@example.com',
    plan: 'premium'
  }
})

analytics.identify({
  userId: 'user@example.com',
  anonymousId: 'anon-123',
  traits: {
    email: 'user@example.com'
  }
})

analytics.identify(
  {
    userId: 'user@example.com',
    traits: { email: 'user@example.com' }
  },
  (err) => {
    if (err) {
      console.error('Identification failed:', err)
    }
  }
)
```

### Event tracking

```javascript theme={null}
analytics.track({
  userId: 'user@example.com',
  event: 'purchase_completed',
  properties: {
    product_id: '123',
    product_name: 'Widget',
    price: 29.99,
    currency: 'USD'
  }
})

analytics.track({
  anonymousId: 'anon-123',
  event: 'page_viewed',
  properties: {
    page: 'homepage'
  }
})

analytics.track({
  userId: 'user@example.com',
  event: 'order_completed',
  properties: { order_id: 'ABC123' },
  timestamp: new Date()
})
```

### Page tracking

```javascript theme={null}
analytics.page({
  userId: 'user@example.com',
  name: 'Home',
  properties: {
    title: 'Homepage',
    url: 'https://example.com'
  }
})

analytics.page({
  userId: 'user@example.com',
  category: 'Docs',
  name: 'Getting Started',
  properties: {
    url: 'https://example.com/docs/getting-started'
  }
})
```

### Screen tracking

```javascript theme={null}
analytics.screen({
  userId: 'user@example.com',
  name: 'Dashboard',
  properties: {
    user_type: 'premium',
    version: '2.0'
  }
})
```

### Group tracking

```javascript theme={null}
analytics.group({
  userId: 'user@example.com',
  groupId: 'company-123',
  traits: {
    name: 'Acme Inc',
    plan: 'enterprise',
    employees: 100,
    industry: 'technology'
  }
})
```

### Alias

```javascript theme={null}
analytics.alias({
  userId: 'user@example.com',
  previousId: 'anon-123'
})
```

The Node.js SDK does **not** include `reset()`. Manage identity per request by passing `userId` / `anonymousId` on each call.
