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

# SDK Overview

> @onlook/core — the attention tracking SDK.

## Installation

```bash theme={null}
npm install @onlook/core
```

## Exports

| Export                   | Description                                   |
| ------------------------ | --------------------------------------------- |
| `track(userId, config?)` | Start a session and return a `Session` object |
| `Session`                | Class with `.on()`, `.stop()`, `.score`       |
| `OnlookConfig`           | TypeScript type for configuration             |
| `AttentionEvent`         | TypeScript type for signal events             |

## Configuration

```ts theme={null}
interface OnlookConfig {
  context?: string         // Label for this surface (default: window.location.pathname)
  threshold?: number       // Intervention trigger score (default: 40)
  ingestUrl?: string       // Custom ingest endpoint for self-hosting
  interventionCooldown?: number  // Seconds between interventions (default: 60)
  signals?: {
    face?: boolean         // Enable face detection (default: false)
    idle?: number          // Idle timeout in seconds (default: 30)
  }
}
```

## Pages

<CardGroup cols={2}>
  <Card title="track()" icon="play" href="/sdk/track">
    Start a tracked session.
  </Card>

  <Card title="Session" icon="brackets-curly" href="/sdk/session">
    Session object methods and properties.
  </Card>

  <Card title="Events" icon="bell" href="/sdk/events">
    All signal and lifecycle events.
  </Card>
</CardGroup>
