Installation
The NeuroID JavaScript Library is customized for your Site Id and hosted on NeuroID servers. It enables specific versions of the library as per your configuration.
Authentication
Basic authentication is used, and your key will be integrated into your configuration, loaded by the JS snippet you're using. For any questions, contact our Implementation Engineering team at [email protected].
Integration Steps
The following steps will walk you through implementing the NeuroID JavaScript Library.

NeuroID JavaScript Library Installation Steps
Integration Walkthrough video
1. Install the JavaScript
<!-- The following Snippet is for Test Purposes Only -->
<script type="text/javascript">
(function(n,e,u,r,o,i,d){
n.nid=n.nid||function(){(n.nid.q=n.nid.q||[]).push(arguments)};
o=e.createElement(u);i=e.getElementsByTagName(u)[0];o.async=1;
o.src=r;i.parentNode.insertBefore(o,i);
})(window,document,'script','//scripts.neuro-id.com/c/nid-YOUR_SITEID_HERE-test.js');
</script>
<!-- The following Snippet is for Production -->
<script type="text/javascript">
(function(n,e,u,r,o,i,d){
n.nid=n.nid||function(){(n.nid.q=n.nid.q||[]).push(arguments)};
o=e.createElement(u);i=e.getElementsByTagName(u)[0];o.async=1;
o.src=r;i.parentNode.insertBefore(o,i);
})(window,document,'script','//scripts.neuro-id.com/c/nid-YOUR_SITEID_HERE.js');
</script>
Embed this JavaScript snippet within the <head>
section of your webpage. This snippet may be retrieved from the JavaScript Installation Settings page in the NeuroID Portal or copied from here.
2. Update the JavaScript with your SiteID
If you copy the snippet from here, you must update your JavaScript snippet URL. Your URL will look similar to: //scripts.neuro-id.com/c/nid-abcde123.js
. If you copied your snippet from the NeuroID Portal, please continue to Step 3.
A NeuroID
siteId
uniquely identifies the Application form for which behavioral data is collected. The format is five characters follwed by three numbers, e.g.,abcde123
. You must not reuse asiteId
across multiple forms or applications. Each must be unique.
3. Label Input Fields
Ensure you use descriptive names for your input fields. These will be used during configuration to identify each input field. If you do not have descriptive names, we recommend incorporating unique, stable, and descriptive data-nid-target
attributes into your input fields, e.g., data-nid-target="firstName"
if the input field is a first name field. Please refer to our data-nid-target documentation for more information.
4. Set a unique identifier
nid('identify', identity_id);
Call nid('identify', identity_id);
to provide a unique identifier for the applicant. You must replace identity_id
with your own unique identifier. If you are creating a new applicant identifier within your web application, you must pass this value to your backend.
In order to connect NeuroID Analytics results to a specific individual applicant, you must set an
identity_id
. We recommend setting theidentity_id
as early in the application flow as possible.The
identity_id
must be the same identifier used to persist an applicant's identity in your system. You may refer to this as an Application ID, an Applicant ID, a User ID, a Customer ID, or something similar. No matter what you call it, you must set anidentity_id
that is unique to the applicant and also exists in your system. You will use this value to call the NeuroID API for signals about the applicant.The
identity_id
must meet all the following requirements:
- Must be a string value
- Must consist of only alphanumeric characters, dashes, underscores, or periods
- A minimum length of 3-characters
- A maximum length of 100-characters
- Must not contain any PII
5. Application Submit
nid('applicationSubmit');
Call nid('applicationSubmit');
when the user effectively completes and sends the application at the conclusion of your application process.
6. (Optional) Stop Collection
nid('closeSession');
For specific scenarios, like with a single-page application, you should stop the collection of behavior signals after the conclusion of your application process.
JavaScript Installation Complete π
Your JavaScript installation is now complete.
Please contact NeuroID at [email protected] to complete your site's configuration.
Visit the Advanced Functions documentation to learn more about NeuroID JavaScript functions not covered here.
Updated about 1 year ago