@nuralogix.ai/web-measurement-embedded-app 0.1.0-beta.1 → 0.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,6 +9,15 @@ Need deeper integration details? Check the full docs at [docs.deepaffex.ai/wmea]
9
9
  <meta charset="UTF-8" />
10
10
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
11
11
  <title>Measurement Embedded App Demo</title>
12
+ <style>
13
+ #measurement-embedded-app-container {
14
+ position: fixed;
15
+ top: 100px;
16
+ left: 0;
17
+ width: 100vw;
18
+ height: calc(100vh - 100px);
19
+ }
20
+ </style>
12
21
  <script type="importmap">
13
22
  {
14
23
  "imports": {
@@ -62,8 +71,7 @@ Need deeper integration details? Check the full docs at [docs.deepaffex.ai/wmea]
62
71
  measurementAutoStart: false,
63
72
  cancelWhenLowSNR: true,
64
73
  }
65
- // Optional top/language/api overrides
66
- // top: '100px'
74
+ // Optional language/api overrides
67
75
  // language: 'fr'
68
76
  apiUrl: 'api.na-east.deepaffex.ai', // optional for region specific data processing
69
77
  loadError: function(error) {
@@ -93,7 +101,7 @@ Need deeper integration details? Check the full docs at [docs.deepaffex.ai/wmea]
93
101
 
94
102
  - Set `appPath` to `'.'` when you bundle the assets yourself.
95
103
  - Profile handling: when `bypassProfile` remains `true` (default) we skip demographic submission and emit an `ERROR` event with `PROFILE_INFO_NOT_SET`; set it to `false` once you supply real profile data.
96
- - Optional `top` offset lets you push the UI below your own header (default `'0'`).
104
+ - Style the container you pass to `init` (e.g., position, top, width).
97
105
  - Optional `apiUrl` enables region-specific processing; omitted values follow the backend token's region automatically. When set explicitly, frontend calls your URL (processing where that endpoint runs) while results continue to store in the token's region—verify the combination suits your deployment.
98
106
  - Config options:
99
107
  - `checkConstraints` (default: `true`) – enables constraint validation pre-measurement
@@ -101,8 +109,8 @@ Need deeper integration details? Check the full docs at [docs.deepaffex.ai/wmea]
101
109
  - `cameraAutoStart` (default: `false`) – automatically starts the camera once permission is granted.
102
110
  - `measurementAutoStart` (default: `false`) – automatically starts the measurement once constraints are satisfied.
103
111
  - `cancelWhenLowSNR` (default: `true`) – cancels the measurement if signal-to-noise ratio falls below threshold.
104
- - Language support: `en`, `ja`, `cn`, `es`, `pt`, `it`, `fr`, `de`, `br`.
105
- - Browser locales `zh` and `zh-Hans` automatically fall back to `cn`.
112
+ - Language support: `en`, `ja`, `zh`, `es`, `pt`, `pt-BR`, `it`, `fr`, `de`.
113
+ - Unsupported browser locales fall back to base language (e.g., `zh-TW` `zh`), then to English.
106
114
  - `loadError` is called if assets fail to download or the app cannot initialize.
107
115
 
108
116
  **Methods:**
@@ -141,6 +149,8 @@ event: ((appEvent: AppEvent) => void) | null;
141
149
  **App events dispatched through `measurementApp.on.event`:**
142
150
 
143
151
  - `APP_LOADED` – the embedded app finished its startup sequence.
152
+ - `MEASUREMENT_PREPARED` - Measurement has been prepared
153
+ - `ASSETS_DOWNLOADED` - Assets have been downloaded
144
154
  - `CAMERA_PERMISSION_GRANTED` – the user granted camera access.
145
155
  - `CAMERA_STARTED` – a camera stream opened successfully.
146
156
  - `MEASUREMENT_STARTED` – a measurement run begins.
@@ -163,14 +173,16 @@ measurementApp.setLanguage('es');
163
173
 
164
174
  **Error codes emitted through `measurementApp.on.error`:**
165
175
 
166
- | Code | Meaning |
167
- | -------------------------- | ----------------------------------------------------------------- |
168
- | `CAMERA_PERMISSION_DENIED` | Camera access prompt was rejected. |
169
- | `CAMERA_START_FAILED` | Camera hardware failed to start after permission. |
170
- | `NO_DEVICES_FOUND` | No video input devices detected during enumeration. |
171
- | `PAGE_NOT_VISIBLE` | Measurement was running while the tab or window became hidden. |
172
- | `MEASUREMENT_LOW_SNR` | Signal-to-noise ratio dropped below the acceptable threshold. |
173
- | `WORKER_ERROR` | SDK worker encountered a fatal processing error. |
174
- | `PROFILE_INFO_NOT_SET` | Profile bypass stayed enabled, so demographics were not provided. |
175
- | `COLLECTOR` | Frame collection reported an error |
176
- | `WEBSOCKET_DISCONNECTED` | Realtime WebSocket connection closed or dropped. |
176
+ | Code | Meaning |
177
+ | ---------------------------- | ----------------------------------------------------------------- |
178
+ | `CAMERA_PERMISSION_DENIED` | Camera access prompt was rejected. |
179
+ | `CAMERA_START_FAILED` | Camera hardware failed to start after permission. |
180
+ | `NO_DEVICES_FOUND` | No video input devices detected during enumeration. |
181
+ | `PAGE_NOT_VISIBLE` | Measurement was running while the tab or window became hidden. |
182
+ | `MEASUREMENT_LOW_SNR` | Signal-to-noise ratio dropped below the acceptable threshold. |
183
+ | `WORKER_ERROR` | SDK worker encountered a fatal processing error. |
184
+ | `PROFILE_INFO_NOT_SET` | Profile bypass stayed enabled, so demographics were not provided. |
185
+ | `COLLECTOR` | Frame collection reported an error |
186
+ | `WEBSOCKET_DISCONNECTED` | Realtime WebSocket connection closed or dropped. |
187
+ | `MEASUREMENT_PREPARE_FAILED` | Measurement preparation failed - invalid or missing credentials |
188
+