Getting Started
Pre-requisites
To setup the integration with the Web Measurement Service, you will need the following:
Get a Nuralogix public key
Since the information sent to WMS contains sensitive end-user data (e.g., age, weight etc.), it needs to be encrypted with a public key. NuraLogix will decrypt it with the corresponding private key. The public key will also be used to verify the measurement results signed by Nuralogix using the corresponding private key.
The following files will be generated by NuraLogix:
WMS_PRIVATE_KEY
: a private key stored at NuraLogix.WMS_PUBLIC_KEY
: shared by NuraLogix with you. Update the WMS_PUBLIC_KEY property in the.env
file of the sample app.
Generate a public and private key pair
The measurement results sent back by WMS are encrypted using a public key. Your App will decrypt the results using the corresponding private key. The public key will also be used to verify the profile data signed by you using the corresponding private key. To help you generate these keys, we will be providing you access to a key generation private repository.
The following keys will be generated by you:
PRIVATE_KEY
: update the PRIVATE_KEY property in the.env
file with this key.PUBLIC_KEY
: you will share this public key as part of the Config object that you will host through an endpoint. Sample code to implement this endpoint is provided as part of the sample app.
You will have to update the PUBLIC_KEY and PRIVATE_KEY properties in the .env
file
in the sample app.
Set up an endpoint at your end to override the Config ID settings
It will allow you to enable results encryption and share your public key with us.
Sample code to implement this endpoint is provided as part of the sample app. The
relative path for this endpoint can be changed in server/src/index.ts
in the sample
app. By default, it is /api/settings
. You have to share the full path for this
endpoint with us as we need to configure it in your Config ID.
Example CONFIG OBJECT
:
{
"settings": {
"security": {
"publicKey": "publicKey123",
"encryptResults": true
}
}
}
Set up the Callback URL
WMS will use the pre-configured CALLBACK_URL
to pass back results to your app.
The results are encrypted, signed and passed as a Base64 encoded JSON object query
string, along with the SESSION_ID
that your app passed to WMS at call-in.
Example callback URL:
https://thirdparty.com/example/results?results=<<encrypted and signed results>>
As the encrypted measurement results are Base64 encoded, you have to Base64 decode the results before verifying and decrypting them. The results obtained after this decryption are also Base64 encoded and need to be decoded again. The sample code to implement this is part of the sample app.
The relative path for the CALLBACK_URL in the sample app is /results
. You have
to share the full path with us as we need to configure it in your
Config ID.
For one-way encryption option where the results are not encrypted, please refer to the Legacy Encryption section.
If you are using CNAME, then the callback URL should not be a subpath of the CNAME.
For example, if measurement.domain.com
is the CNAME, then the callback URL must
not be of the form measurement.domain.com/results
. This is required because
the callback URL is hosted at your backend, whereas CNAME points towards the WMS.
Get a config ID (CONFIG_ID
) from NuraLogix
To get going, you need a WMS CONFIG ID
- a unique identifier that is linked to
your app's specific configuration. Before NuraLogix can provide one, you need to
provide NuraLogix some information through an onboarding form. This form will be
shared with you during the onboarding process.
After you provide the above to NuraLogix, you will receive the config ID. Please
update the CONFIG_ID
key in .env
file with it.
Setup a CNAME
Mask the Web Measurement Service URL with your custom URL by creating a CNAME record on your DNS server's management page.
For example, if your app's domain is domain.com
you can setup a CNAME called
measurement
to awe.na-east.nuralogix.ai
. Then measurement.domain.com
will mask the
WMS URL.
The actual instructions for setting up a CNAME can be obtained from the documentation of your domain name provider. Follow those instructions to create the following entry:
- Name: measurement (This can be any name that you choose).
- Type: CNAME
- Alias: Yes
- Value: awe.na-east.nuralogix.ai
After you are done, please send the chosen CNAME to NuraLogix for additional setup on our end.
Once the chosen CNAME is configured, update the service URL in the file
src/Pages/Profile/Profile.tsx
by replacing
https://awe.na-east.nuralogix.ai
with your setup CNAME
(example: https://measurement.domain.com)
Get a Visage SDK License from NuraLogix
Web Measurement Service relies on the Visage Face Tracker and you will need a Visage Face Tracker license bound to your domain name. NuraLogix will obtain one for you as part of the WMS package. Do please let us know if you would prefer to obtain one directly from Visage. It will need to be hosted by NuraLogix since it's used by WMS.