Skip to main content

Documentation Index

Fetch the complete documentation index at: https://onlook.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Installation

npm install @onlook/core

Exports

ExportDescription
track(userId, config?)Start a session and return a Session object
SessionClass with .on(), .stop(), .score
OnlookConfigTypeScript type for configuration
AttentionEventTypeScript type for signal events

Configuration

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

track()

Start a tracked session.

Session

Session object methods and properties.

Events

All signal and lifecycle events.