/everything-evenhub:device-featuresfrom everything-evenhub
Integrates G2 hardware features in Even Hub apps: microphone audio capture (glasses or phone mic), IMU motion data, location, camera/album picker, device info, user info, and local storage.
Ships in everything-evenhub. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are implementing G2 hardware feature integration for an Even Hub app. Use the reference below to implement exactly what $ARGUMENTS describes.
createStartUpPageContainer must succeed before calling imuControl or audioControl(true, AudioInputSource.Glasses) — both depend on the glasses-side startup page being established first. Phone-mic audio, location APIs, pickImageFromAlbum, and captureImageFromCamera do NOT require the startup page — they route through the phone, not the glasses.
Start the microphone with await bridge.audioControl(true, source) and stop it with await bridge.audioControl(false). The source argument picks which mic to capture from:
AudioInputSource.Glasses — G2 four-mic array (default; requires createStartUpPageContainer first)AudioInputSource.Phone — phone microphone (no startup-page requirement)Omit the second argument and the SDK defaults to AudioInputSource.Glasses (backward-compat with pre-0.0.11 code).
Audio data arrives through the onEvenHubEvent listener. Access it via event.audioEvent, which carries source (the mic the buffer came from) and audioPcm (a Uint8Array).
Format on both sources: PCM, 16 kHz sample rate, signed 16-bit little-endian, mono channel.
import { AudioInputSource } from '@evenrealities/even_hub_sdk'
// Glasses MIC — requires createStartUpPageContainer to have succeeded
await bridge.audioControl(true, AudioInputSource.Glasses)
// Phone MIC — no startup-page requirement
// await bridge.audioControl(true, AudioInputSource.Phone)
const unsubscribe = bridge.onEvenHubEvent(event => {
const audio = event.audioEvent
if (!audio) return
// audio.source: AudioInputSource.Glasses | AudioInputSource.Phone
// audio.audioPcm: Uint8Array
// Process PCM (Web Audio API, speech recognition, etc.)
})
// Stop and clean up
await bridge.audioControl(false)
unsubscribe()
Permissions: declare g2-microphone for AudioInputSource.Glasses and phone-microphone for AudioInputSource.Phone in app.json. Declare only the source(s) the app actually uses.
Start IMU reporting with await bridge.imuControl(true, ImuReportPace.P500) and stop with await bridge.imuControl(false).
ImuReportPace enum values: P100, P200, P300, P400, P500, P600, P700, P800, P900, P1000. These are protocol pacing codes, not literal Hz values.
IMU data arrives via onEvenHubEvent. Access it through event.sysEvent.imuData, which has the shape { x: float, y: float, z: float }. Filter events by checking sys.eventType === OsEventTypeList.IMU_DATA_REPORT.
import { ImuReportPace, OsEventTypeList } from '@evenrealities/even_hub_sdk'
await bridge.imuControl(true, ImuReportPace.P500)
const unsubscribe = bridge.onEvenHubEvent(event => {
const sys = event.sysEvent
if (!sys?.imuData) return
if (sys.eventType !== OsEventTypeList.IMU_DATA_REPORT) return
const { x, y, z } = sys.imuData
console.log('IMU:', x, y, z)
})
await bridge.imuControl(false)
unsubscribe()
Two modes — one-shot reads and continuous updates. Both read from the phone's location services; declare location in app.json permissions before calling. No createStartUpPageContainer requirement.
getAppLocation(options?)import { AppLocationAccuracy } from '@evenrealities/even_hub_sdk'
const fix = await bridge.getAppLocation({
accuracy: AppLocationAccuracy.High,
timeoutMs: 5000,
})
if (fix) {
console.log(fix.latitude, fix.longitude)
} else {
// No fix in time, permission denied, or invalid coords. Handle gracefully.
}
Returns AppLocation | null. Always null-check — the host returns null when it has no fix in time, the user denied permission, or the coordinates are invalid.
startAppLocationUpdates(options?) + onAppLocationChanged(cb)await bridge.startAppLocationUpdates({
accuracy: AppLocationAccuracy.Medium,
intervalMs: 1000,
distanceFilter: 5, // meters — host skips pushes smaller than this
})
const unsubscribeLocation = bridge.onAppLocationChanged(loc => {
console.log(loc.latitude, loc.longitude, loc.speed)
})
// Stop and clean up
await bridge.stopAppLocationUpdates()
unsubscribeLocation()
AppLocationAccuracy valuesAppLocationAccuracy.Low — city-level; cheapest, kindest to batteryAppLocationAccuracy.Medium — block-level; balanced defaultAppLocationAccuracy.High — best available fix; most batteryAppLocation shapelatitude — number, degreeslongitude — number, degreesaccuracy? — number, horizontal accuracy in metersaltitude? — number, meters above sea levelspeed? — number, meters per secondheading? — number, degrees from true northtimestamp? — number, Unix millisecondsAppLocationOptions fields (all optional)accuracy — AppLocationAccuracytimeoutMs — one-shot only; max wait for a fixintervalMs — continuous only; requested push cadencedistanceFilter — continuous only; metersstartAppLocationUpdates is stopped when the WebView is suspended on Android (see background-state). Re-arm on foreground; cached fixes from bridge.setLocalStorage are fine to render while you wait.
Two ways to bring an image into the app from the phone — pick from album or capture from the phone camera. Both are single-shot, return one AppImageAsset, and use phone hardware. The G2 has no on-glasses camera.
const fromAlbum = await bridge.pickImageFromAlbum() // requires `album` permission
const fromCamera = await bridge.captureImageFromCamera() // requires `camera` permission
if (fromAlbum) {
// fromAlbum.base64 is ready to drop into an <img src="data:...">
}
Both return null when the user cancels the picker / camera or denies permission. The album picker is single-select only — no multi-import.
AppImageAsset shapepath — string, host-side path (opaque to the WebView)name — string, original filenamemimeType — string, e.g. image/jpeg, image/pngsize — number, bytesbase64 — string, inline data ready for <img> or further processingbase64 is ready to display in the WebView immediately, but pumping a 12-megapixel JPEG into a glasses container via updateImageRawData is still expensive even with the SDK's internal LZ4 compression (0.0.12+) — compression shrinks the transfer, it does not resize the pixels. Downscale to the container's dimensions and convert to 4-bit greyscale before sending pixels to the glasses. See glasses-ui for image-container patterns.
await bridge.getDeviceInfo() returns a DeviceInfo object or null.
DeviceInfo fields:
model — DeviceModel enum (DeviceModel.G1 = "g1", DeviceModel.G2 = "g2", DeviceModel.Ring1 = "ring1")sn — serial number stringstatus — a DeviceStatus objectDeviceStatus interface fields:
sn — serial numberconnectType — a DeviceConnectType enum valueisWearing? — boolean, whether the user is wearing the devicebatteryLevel? — integer 0–100isCharging? — booleanisInCase? — booleanDeviceConnectType enum values: None, Connecting, Connected, Disconnected, ConnectionFailed
DeviceStatus helper methods: isNone(), isConnected(), isConnecting(), isDisconnected(), isConnectionFailed()
For real-time status updates, subscribe with bridge.onDeviceStatusChanged:
const unsubscribe = bridge.onDeviceStatusChanged(status => {
console.log('Battery:', status.batteryLevel)
console.log('Connected:', status.isConnected())
})
Call unsubscribe() to stop listening.
await bridge.getUserInfo() returns a UserInfo object.
UserInfo fields:
uid — number, unique user identifiername — string, display nameavatar — string, URL to the user's avatar imagecountry — string, user's country codePersist data to the Even Realities App (survives app restarts):
await bridge.setLocalStorage(key, value) — stores a string value; returns boolean indicating successawait bridge.getLocalStorage(key) — retrieves a stored string; returns an empty string if the key does not existThe Even App WebView is a Flutter WebView. Browser IndexedDB and browser localStorage do NOT reliably persist across app restarts in this environment — data saved there can be lost when the user closes and reopens the app.
Use bridge.setLocalStorage / bridge.getLocalStorage for all user state: settings, progress, bookmarks, preferences, cached content. For large content (e.g. ebook text), chunk it across multiple keys:
const CHUNK_SIZE = 50_000 // chars per key
const PREFIX = 'myapp.content_'
async function saveContent(bridge: EvenAppBridge, id: string, text: string) {
const chunks = Math.ceil(text.length / CHUNK_SIZE)
await bridge.setLocalStorage(`${PREFIX}${id}_n`, String(chunks))
for (let i = 0; i < chunks; i++) {
await bridge.setLocalStorage(
`${PREFIX}${id}_${i}`,
text.slice(i * CHUNK_SIZE, (i + 1) * CHUNK_SIZE),
)
}
}
See glasses-ui → Best Practices for debouncing and serializing bridge writes.
Always stop hardware features and unsubscribe event listeners when the app exits or is destroyed. Failing to do so may leave the microphone or IMU running on the glasses hardware.
// Store all unsubscribe functions and stop hardware on exit
window.addEventListener('beforeunload', () => {
bridge.audioControl(false)
bridge.imuControl(false)
bridge.stopAppLocationUpdates()
unsubscribe() // from onEvenHubEvent
unsubscribeLocation() // from onAppLocationChanged
})
Apply the same pattern for any hardware feature that requires explicit stop/start control (audioControl, imuControl, startAppLocationUpdates).
The following capabilities are not available through the Even Hub SDK:
captureImageFromCamera, see Photos above)$ARGUMENTS
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub even-realities/everything-evenhub --plugin everything-evenhub13 skills in this plugin
/background-stateImplement background state persistence for Even Hub G2 plugins — automatically analyzes existing plugin code, identifies state that needs to survive background/foreground transitions, and inserts setBackgroundState + onBackgroundRestore calls. Use when a plugin loses state after the phone goes to the background and returns./build-and-deployPackage and deploy an Even Hub G2 app — validate app.json, build, pack into .ehpk, upload it as a build, invite beta testers, and promote it to the beta channel. Use when packaging, deploying, uploading, distributing to testers, putting a build on beta, or submitting an Even Hub app./cli-referenceEven Hub CLI command reference — login, logout, self-check, init, pack, qr, create, upload, update, ls, promote, delist, testers, rm, download. Exit codes, --json output keys, and the checks that run locally before a request is sent. Use when running any CLI command, creating or uploading an app, managing beta testers and channels, or scripting the CLI in CI./design-guidelinesUI/UX design guidelines for Even Hub G2 smart glasses — display constraints, layout patterns, icon design, Unicode characters, and community resources. Use when designing glasses app interfaces or planning layouts./font-measurementPixel-accurate font measurement for Even Realities G2 glasses — predict text layout dimensions matching the LVGL rendering engine. Use when sizing text containers precisely./glasses-uiBuild glasses display UI for Even Hub G2 apps — text containers, lists, images, page lifecycle, and layout patterns on the 576x288 canvas. Use when creating or updating glasses display content.Other plugins' skills for the same job