Skip to main content

Overview

Events are the primary way your app receives data from the glasses. All event handlers are accessed through session.events.

Available Events

Transcription Events

TranscriptionData fields

  • text: The transcribed text
  • isFinal: Whether this is a final or interim result
  • transcribeLanguage: Language code (e.g., ‘en-US’)
  • startTime: Timestamp when speech started
  • endTime: Timestamp when speech ended
  • confidence: Confidence score (0-1)
  • provider: Transcription provider used

Button Events

ButtonPress fields

  • buttonId: Button identifier (e.g., ‘main’)
  • pressType: ‘short’ or ‘long’

Head Position Events

Photo Events

Location Events

Phone Notifications

Connection Events

Event Patterns

Debouncing Events

State Machines

Event Filtering

Multi-User Events

For apps that support multiple users:

Best Practices

Event handlers are automatically cleaned up when the session ends, but you can manually remove them:

Performance Tips

  • Filter events early: Return early from handlers if the event isn’t relevant
  • Debounce rapid events: Use timeouts to batch rapid events
  • Avoid blocking operations: Use async/await for long-running tasks
  • Clean up resources: Remove handlers and clear timers when done