NeuroID Integration
Alloy's SDK supports NeuroID's behavioral analytics. On
alloy.init(), the SDK loads NeuroID's collector for the site you configured, identifies the session, and returns the two identifiers to submit with your application.
Set up the Alloy SDK by following the installation instructions here.
Available since @alloyidentity/web-sdk v1.0.2
Values from NeuroID
NeuroID provides this when your service is set up. You enter it in the Alloy Dashboard, and the SDK reads it from your configuration.
| Value | Description | Required |
|---|---|---|
| Site ID | The site the collector reports to, from the NeuroID dashboard. It begins with form_, and the SDK strips that prefix to build the collector URL, so a value without it loads the wrong script. The value you send to Alloy keeps the prefix. | Always |
Configure NeuroID in the Alloy Dashboard
- Go to Settings > Services and add your NeuroID credentials.
- Go to Settings > SDK, open Device and Behavioral Risk Service Settings, and tick Enable Neuro ID. Fill in Site Id. The setting applies to the SDK key shown on that page.
Journey Integration
1. Collect the identifiers in the browser
Call alloy.init() on each page where you want NeuroID to run, and read both identifiers from the response.
import alloy from '@alloyidentity/web-sdk';
const { neuroUserId, neuroIdSiteId } = await alloy.init({
key: 'YOUR_SDK_KEY',
production: true,
});production selects the NeuroID site the collector reports to. It defaults to false, which appends -test to your Site ID.
2. Submit the Journey Application
Include both identifiers in the entity's data object when you call POST /applications.
POST /v1/journeys/{journey_token}/applications
{
"entities": [
{
"entity_type": "person",
"branch_name": "persons",
"data": {
"neuro_user_id": "<value of neuroUserId>",
"site_id": "<value of neuroIdSiteId>"
}
}
]
}Workflow Integration
If you submit Evaluations directly instead of Journey Applications, follow step 1. For step 2, send the fields below in the body of POST /evaluations instead.
POST /v1/evaluations
{
"neuro_user_id": "<value of neuroUserId>",
"site_id": "<value of neuroIdSiteId>"
}The Session Identifier
neuroUserId is what NeuroID calls the identity ID. The SDK generates one, stores it in sessionStorage under identityId, and reports it to NeuroID. Because the store is sessionStorage, every page initialized in the same tab shares the identifier, and a new tab starts a new one.
To use an identifier you already generate, pass it as neuroUserId. Available since v2.2.4.
const { neuroUserId, neuroIdSiteId } = await alloy.init({
key: 'YOUR_SDK_KEY',
production: true,
neuroUserId: 'YOUR_USER_IDENTIFIER',
});The value is only adopted if the tab does not already have one. Once an identifier exists, later calls keep it and ignore what you pass, so set it on the first alloy.init() of the session. Always send back the neuroUserId the response returns rather than the value you passed.
Reference
alloy.init() options
alloy.init() optionsThese are the options you pass in code. The Site ID is configured in the Dashboard instead, as described in Set Up.
| Option | Required | Description |
|---|---|---|
key | Yes | Your SDK key, from Settings > SDK |
production | No | Selects the NeuroID site. Defaults to false, which appends -test to your Site ID |
neuroUserId | No | A session identifier you generate. The SDK generates one when you omit it. Available since v2.2.4 |
neuroIdFunnel | No | A funnel name, reported to NeuroID as the funnel variable. Available since v2.2.7 |
Fields
alloy.init() returns | Send to Alloy as | Required |
|---|---|---|
neuroUserId | neuro_user_id | Yes |
neuroIdSiteId | site_id | Yes |
Network Requirements
Allow these in your Content Security Policy and any network or DNS filtering:
| URL | Purpose |
|---|---|
scripts.neuro-id.com | NeuroID's collector, loaded by the SDK |
The collector loads a further script of its own and sends its data packets from the browser. Those hosts are not part of your Alloy configuration, so confirm them with NeuroID before locking down a Content Security Policy or a DNS filter.
Additional Information
NeuroID publishes its own Alloy integration guide, covering its products and its mobile SDKs.
Updated 10 days ago