Skip to content

Last updated: 2026-12-05

An Even Hub app brings together a Plugin experience and an optional Widget experience in one .ehpk package. The Plugin experience handles interaction and settings. Widgets show information on the glasses Dashboard, so users can check a delivery status or their next appointment at a glance.

An Even Hub app can provide one Widget, with Card and Expanded views that share configuration and data. Add Widgets when this glanceable view is useful; an app can provide only a Plugin experience. Notifications are an optional capability of apps with Widgets. Notification permission and Dashboard placement are separate user choices.

Requires Even Realities App 2.5.0+ and min_sdk_version 0.0.16+.

What users see ​

ViewCanvasDelivery example
Card352 × 288A summary and the most relevant deliveries
Expanded576 × 288More deliveries or more detail from the same response

Both views share configuration and data. Users expand the Card to read more; the Widget itself displays information without custom tap actions. Your Plugin settings page provides any account connection or settings.

How it works ​

The Even Realities App initiates each data request on the phone. Your backend returns data in response; the App binds that data to the Widget layout and sends the result to the glasses.

┌─────────────┐   HTTPS   ┌────────────┐  Bluetooth  ┌───────────┐
│ Backend     │ ◄──────── │ Phone      │ ──────────► │ Even G2   │
│ Widget JSON │ ────────► │ Map + bind │             │ Dashboard │
└─────────────┘           └────────────┘             └───────────┘
  1. The App reads widget/manifest.json, checks the user's saved settings and schedules data requests using data.interval.
  2. The App sends the request to your backend. Your backend authenticates it and returns display data.
  3. The App maps the response through responseMap and bindings for both Card and Expanded.
  4. The App sends the content over Bluetooth. The glasses display it within the selected Widget view.
You provideThe App handles
widget/layout.jsonRendering the declared containers in Card and Expanded
widget/manifest.jsonConfiguration validation, request scheduling and data binding
Plugin settings pageReading values saved through SDK local storage
Backend responsePreparing text and images, then sending them to the glasses

Add the files ​

For a Vite-based Even Hub app, put the Widget files in public/widget/. Vite copies them into dist/widget/ when you build. They must be available at <project-url>/widget/manifest.json during preview.

text
my-plugin/
├── app.json
├── index.html
└── public/
    └── widget/
        ├── manifest.json
        └── layout.json

Keep the Plugin experience as the entry point for account connection and settings. An app focused on Widgets can use a simple settings page without building an additional interactive glasses UI.

1. Describe both views ​

Create public/widget/layout.json. This minimal example displays one field in each view:

json
{
  "card": {
    "containerTotalNum": 1,
    "textObject": [
      {
        "containerID": 1,
        "containerName": "summary",
        "xPosition": 16,
        "yPosition": 16,
        "width": 320,
        "height": 84,
        "content": ""
      }
    ],
    "imageObject": []
  },
  "expanded": {
    "containerTotalNum": 1,
    "textObject": [
      {
        "containerID": 1,
        "containerName": "summary",
        "xPosition": 24,
        "yPosition": 16,
        "width": 528,
        "height": 196,
        "content": ""
      }
    ],
    "imageObject": []
  }
}

The shared name summary lets both views use the same binding. Give containers different names when Expanded needs to show additional fields.

2. Connect data to the layout ​

Create public/widget/manifest.json:

json
{
  "layout": "layout.json",
  "config": {},
  "interval": { "seconds": 300 },
  "data": {
    "interval": 300,
    "endpoint": "https://api.example.com/widget",
    "request": {
      "method": "GET",
      "url": "https://api.example.com/widget"
    },
    "responseMap": { "summary": "$.summary" }
  },
  "defaultData": {
    "config": {},
    "response": { "summary": "3 deliveries in transit" }
  },
  "bindings": {
    "summary": { "from": "data.summary" }
  }
}

Use an integer of at least 60 seconds for data.interval. The GET example supports older Portal validators by keeping data.request.url equal to data.endpoint and interval.seconds equal to data.interval.

The App reads GET (the default) with mapped data.request.query parameters or POST with mapped data.request.body parameters. CLI 0.3.1 can package both methods and accepts the new fields without the compatibility fields. If you use that form, check Portal upload acceptance separately.

Replace https://api.example.com/widget with your own endpoint before testing live data. Return JSON with the same shape as defaultData.response:

json
{ "summary": "2 deliveries in transit" }

The App first maps the response to data.summary, then binds that value to the containers named summary. Default data follows the same path and provides the initial display while live data loads. Use representative sample content with no personal information.

Preview and test ​

  1. Run your development server on a LAN address reachable from your phone.
  2. Generate a QR with evenhub qr --url http://<your-lan-ip>:5173/.
  3. In the Even Realities App, open Even Hub → profile → Developer hub → Widget preview and scan it.
  4. Check both Card and Expanded. Default data appears first, followed by live data when the request succeeds.
  5. Edit the JSON and select Reload to fetch the files and data again. Use the settings button to open your Plugin settings page.
  6. Select Add to Dashboard to check the glasses. The Dashboard has five slots shared by built-in and third-party Widgets.

QR preview does not deliver notifications, including when its Widget is added to the Dashboard. Use an installed Private build for notification testing.

Prototype mode opens the Plugin settings page. Widget preview loads its Widget files. Both use the project URL; choose the entry point for the capability you are testing.

Keep the preview URL stable, including its port and trailing slash. Configuration is isolated by the full project URL. See Local Testing for setup and Test for packaged checks.

Add user settings when needed ​

Use the Plugin settings page to save settings through the SDK bridge. Check that the write succeeds before telling the user to return:

typescript
const saved = await bridge.setLocalStorage('deliveryScope', 'inTransit')
if (!saved) throw new Error('Could not save the delivery preference')

Here bridge is your initialized SDK bridge. Replace the minimal example's config: {} with:

json
"config": {
  "scope": {
    "type": "string",
    "source": { "localStorage": "deliveryScope" },
    "required": true,
    "enum": ["inTransit", "all"]
  }
}

The storage key is deliveryScope; the configuration field is scope. source.localStorage connects them. Add this fragment inside data.request, keeping its existing method and URL:

json
"query": {
  "scope": { "from": "config.scope" }
}

Set defaultData.config to { "scope": "inTransit" } for the sample configuration. Your backend reads the scope query parameter and returns the corresponding summary. Configuration and response data are shared by Card and Expanded.

Required settings that are missing or invalid put the Widget into needs setup and prevent the request. Closing the settings page causes the App to read the configuration and fetch again. With no required settings, the Widget can fetch immediately.

Data and refresh behavior ​

Widget requests are made by the native App network layer. WebView CORS rules apply to requests from your Plugin settings page; they do not apply to this native fetch path.

ConcernBehavior
Requestdata.endpoint, with any query parameters already in the URL and your mapped business parameters. Notifications use a separate request to notify.endpoint. Use HTTPS for release packages
ResponseUTF-8 JSON, 2xx status, at most 256 KB including base64 images; 15-second request timeout
VersionApp sends X-EvenHub-Plugin-Version from app.json.version
RefreshCLI packaging requires data.interval to be an integer of at least 60 seconds. Data requests for the same app do not overlap
App not runningRefresh stops; glasses retain their last content
Failed refresh after successLast successful content is retained
Recipient IDFor an installed app with notify declared, notifications enabled for that app, and glasses bound, data requests carry the same opaque X-EvenHub-Recipient-Id as notification requests. See recipient binding

Return display-ready strings from your backend. Date formatting, conditional logic and calculations belong there. The App supports field lookup and simple template binding.

Keep shared secrets on your backend. The App sends Accept: application/json and X-EvenHub-Plugin-Version, plus Content-Type: application/json for POST. For account-specific data, use the settings page to connect your user and have your backend validate that association.

Closing settings, returning to the foreground and reconnecting glasses can trigger an immediate Widget refresh. After glasses restart, the App fetches again and resends the content. Periodic Widget data refresh runs while the App is running and the Widget is on the Dashboard. An installed app with notifications enabled also makes recipient binding requests when needed without Dashboard placement. Data refresh leaves the notification timer unchanged.

GET follows up to five redirects, never from HTTPS to HTTP. Cross-origin redirects drop the X-EvenHub- headers. POST does not follow redirects. Data responses are used only for Widgets; any notification field is ignored.

Layout limits ​

ItemLimit
ViewsBoth card and expanded are required. Each view has at least one container, and its containerTotalNum equals its text plus image count
ContainersKeep each container within the view. IDs and names are unique within a view and may be reused across views
TextAt most 8 text containers per view; fixed font size 20, line height 28 px, top-left aligned
OverflowText wraps and is clipped at the container boundary
Text budget32 UTF-8 bytes per container for initial layout content; 512 for refreshed content
ImagesUp to 4 image containers per view, each at most 100 × 100 px. For CLI 0.3.1 packaging, use 20–100 px on each side. The backend returns base64 image content for the App to convert and send

Use text for this first Widget. Allow enough room for the longest expected content and verify both views on glasses.

Images and icons ​

Bind image containers with { "from": "data.image" }, mapping the response field through responseMap. Return the image file as base64, not a URL. PNG, BMP, JPEG, WebP and the first frame of GIF are supported. Data-URL prefixes are accepted.

The App scales and center-crops images to the container size, converts them to 16 grayscale levels and treats transparency as black (unlit). Return images at the container dimensions to avoid cropping. Missing or invalid live image values clear the previous image. Invalid sample images in defaultData make the Widget declaration invalid.

For a status icon, add "icon": "icon.png" to the manifest and bundle the file under widget/. Design it at 24 × 24 px. The layout and icon references must be filenames in that directory, without path separators or ... Give the icon its own filename, distinct from the layout, manifest.json and fixture.json.

Default data and store previews ​

defaultData provides the initial content while live data loads. Keep its text short: initial layout content is limited to 32 UTF-8 bytes per container. Sample images must be decodable base64 embedded in the response.

Where it appearsData source
Initial Widget content on the phone and glassesmanifest.defaultData
Add Widget card in the Even Realities AppOptional widget/fixture.json, falling back to defaultData
Preview generated by the Portal on uploadmanifest.defaultData

Give both sample responses the shape expected by responseMap and bindings. fixture.json uses the same { "config": {}, "response": {} } structure as defaultData. For the upload preview, ensure every text binding resolves from the sample data. Use an empty string for any optional text you want to leave blank.

Package with your Even Hub app ​

Build your existing project, check that dist/widget/ contains both JSON files, then use the same packaging flow as the rest of your Even Hub app. Test the packaged Widget without the development server before submitting.