session.camera.takePhoto() to capture a photo from the user’s smart glasses. The method returns a promise that resolves with the photo data.
Quick Start
Permissions
Your app needs the camera permission to take photos. Add it in the Developer Console when creating or editing your app. Check permission at runtime:Options
Pass an options object to control the capture:| Option | Type | Default | Description |
|---|---|---|---|
size | "small" | "medium" | "large" | "full" | "medium" | Photo resolution |
compression | string | undefined | Compression level |
saveToGallery | boolean | false | Save the photo to the user’s gallery |
sound | boolean | true | Play a shutter sound on capture |
timeout | number | 5000 | Timeout in milliseconds |
Return Value
takePhoto() returns a Promise<PhotoData> with the following fields:
| Field | Type | Description |
|---|---|---|
url | string | URL to the captured photo |
width | number | Photo width in pixels |
height | number | Photo height in pixels |
timestamp | number | Unix timestamp of the capture |
savedToGallery | boolean | Whether the photo was saved to the gallery |
Photo Sizes
The resolution depends on the requested size and connection type.| Size | WiFi Resolution | BLE Resolution |
|---|---|---|
small | 640x480 | 400x300 |
medium | 1280x960 | 640x480 |
large | 1920x1440 | 800x600 |
full | 3264x2448 | 1024x768 |
Common Patterns
Take a photo and upload it
Take multiple photos with a delay
Save to gallery
Migrating from v2
Three changes to be aware of:requestPhoto()is nowtakePhoto(). The method name changed, but the usage pattern is the same.customWebhookUrlandauthTokenoptions are removed. Photos are returned directly from the promise.onPhotoTaken()is deprecated. Use the promise returned bytakePhoto()instead.

