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.

Score events

score

Fires every time the attention score changes.
session.on('score', ({ score, delta, signals }) => {
  console.log(`Score: ${score}, change: ${delta}`)
})
FieldTypeDescription
scorenumberNew score (0–100)
deltanumberChange from previous score
signalsstring[]Signals that triggered the change

drop

Fires when the score falls below the configured threshold.
session.on('drop', ({ score, threshold }) => {
  triggerIntervention()
})

recover

Fires when the score rises back above the threshold after a drop.
session.on('recover', ({ score }) => {
  dismissIntervention()
})

Lifecycle events

stopped

Fires when session.stop() is called.

paused / resumed

Fires when session.pause() or session.resume() is called.

Signal events

Subscribe to raw signal events for custom handling.
session.on('signal', ({ type, value }) => {
  // type: 'FACE_DETECTED' | 'IDLE' | 'TAB_HIDDEN' | ...
})