@nuralogix.ai/web-measurement-embedded-app 0.1.0-alpha.1

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/LICENSE ADDED
@@ -0,0 +1,12 @@
1
+ Copyright (c) 2025, Nuralogix Corp.
2
+ All Rights reserved
3
+
4
+ THIS SOFTWARE IS LICENSED BY AND IS THE CONFIDENTIAL AND
5
+ PROPRIETARY PROPERTY OF NURALOGIX CORP. IT IS
6
+ PROTECTED UNDER THE COPYRIGHT LAWS OF THE USA, CANADA
7
+ AND OTHER FOREIGN COUNTRIES. THIS SOFTWARE OR ANY
8
+ PART THEREOF, SHALL NOT, WITHOUT THE PRIOR WRITTEN CONSENT
9
+ OF NURALOGIX CORP, BE USED, COPIED, DISCLOSED,
10
+ DECOMPILED, DISASSEMBLED, MODIFIED OR OTHERWISE TRANSFERRED
11
+ EXCEPT IN ACCORDANCE WITH THE TERMS AND CONDITIONS OF A
12
+ NURALOGIX CORP SOFTWARE LICENSE AGREEMENT.
package/README.md ADDED
@@ -0,0 +1,74 @@
1
+ ### Web Measurement Embedded App
2
+
3
+ ```html
4
+ <!DOCTYPE html>
5
+ <html lang="en">
6
+ <head>
7
+ <meta charset="UTF-8" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
9
+ <title>Measurement Embedded App Demo</title>
10
+ <script type="importmap">
11
+ {
12
+ "imports": {
13
+ "@nuralogix.ai/web-measurement-embedded-app": "https://unpkg.com/@nuralogix.ai/web-measurement-embedded-app",
14
+ }
15
+ }
16
+ </script>
17
+ </head>
18
+ <body>
19
+ <div id="measurement-embedded-app-container"></div>
20
+ <script type="module">
21
+ import MeasurementEmbeddedApp, { faceAttributeValue } from '@nuralogix.ai/web-measurement-embedded-app';
22
+ const measurementApp = new MeasurementEmbeddedApp();
23
+ const container = document.getElementById('measurement-embedded-app-container');
24
+ if (container) {
25
+ const apiUrl = '/api';
26
+ const studyId = await fetch(`${apiUrl}/studyId`);
27
+ const studyIdResponse = await studyId.json();
28
+ const token = await fetch(`${apiUrl}/token`);
29
+ const tokenResponse = await token.json();
30
+ if (studyIdResponse.status === '200' && tokenResponse.status === '200') {
31
+ measurementApp.init({
32
+ container,
33
+ top: '100px',
34
+ appPath: '.',
35
+ settings: {
36
+ token: tokenResponse.token,
37
+ refreshToken: tokenResponse.refreshToken,
38
+ studyId: studyIdResponse.studyId,
39
+ },
40
+ profile: {
41
+ age: 40,
42
+ height: 180,
43
+ weight: 60,
44
+ sex: faceAttributeValue.SEX_ASSIGNED_MALE_AT_BIRTH,
45
+ smoking: faceAttributeValue.SMOKER_FALSE,
46
+ bloodPressureMedication: faceAttributeValue.BLOOD_PRESSURE_MEDICATION_FALSE,
47
+ diabetes: faceAttributeValue.DIABETES_NONE,
48
+ unit: 'Metric',
49
+ },
50
+ loadError: function(error) {
51
+ console.error("load rror", error);
52
+ }
53
+ });
54
+ measurementApp.on.results = (results) => {
55
+ console.log("Results received", results);
56
+ measurementApp.destroy();
57
+ };
58
+ measurementApp.on.error = (error) => {
59
+ console.log("error received", error);
60
+ };
61
+ measurementApp.on.webhook = (webhook) => {
62
+ console.log("Webhook received", webhook);
63
+ };
64
+ measurementApp.on.cancel = () => {
65
+ console.log("Measurement cancelled");
66
+ };
67
+ } else {
68
+ console.error('Failed to get Study ID and Token pair');
69
+ }
70
+ }
71
+ </script>
72
+ </body>
73
+ </html>
74
+ ```