Primary Methods

Methods for the SDK to function properly.

SDK Methods

Below each method you will see a brief description as well as a code example for each of the supported platform/frameworks. If you do not see a command example in a specific language/platform then the command is not available or not relevant for that platform.

configure

Configures NeuroID SDK to be ready to collect and send events. Call prior to any other command.

ParametersType
ClientKeyString
Application**ApplicationMain
ReactNative Options***ReactNativeOptions
Returns
Boolean - Signifies if the command was successful or not. If false, error logs will be printed to indicate the failure reason. Failure would be because an invalid clientKey was passed in.

Note: For Android, this is the initialization function and it is used in conjunction with setNeuroIDInstance

Note: For React-Native, an optional object is passed in to configure the SDK to collect based on unique React-Native behavior - TO-DO Expound RNOptions

NeuroID.configure(clientKey: "my_api_key")
val neuroID = NeuroID.Builder(
  this,
  "my_api_key"
).build()
await NeuroID.configure('my_api_key', {
  usingReactNavigation: true,
});

** Android only

*** React Native only

setNeuroIDInstance

SDK Version 3.4.0: Android

Save NeuroID Class Instance for further use. Used in conjunction with the configure method.

ParametersType
NeuroIDNeuroIDClassInstance
Returns
Void
NeuroID.setNeuroIDInstance(neuroID)

setVerifyIntegrationHealth

Create the Integration Health Report and print out access instructions. Should be called after configure.

Note: Please see the instructions for report installation for each platform - iOS , Android , React Native

ParametersType
VerifyIntegrationBoolean
Returns
Void
NeuroID.setVerifyIntegrationHealth(true)
NeuroID.getInstance()?.setVerifyIntegrationHealth(true)
await NeuroID.setVerifyIntegrationHealth(true)

startSession

Begin a new session and start sending events to NeuroID.

If a sessionID is provided it will be used, otherwise a new sessionID will be generated. Requirements for sessionID are the same for userID (see setUserID).

ParametersType
SessionIDString?
Returns
StartSessionResult Object
started:Boolean - Boolean signifying the command was successful or not. If false, error logs will be printed to indicate the failure reason.
sessionID:String - String of the sessionID passed in or generated by the SDK.

Failure Reasons:
Failure because no clientKey was found indicates that the configure command was not called prior.
Failure because invalid userID indicates that an invalid sessionID was passed in. See requirements under setUserID
NeuroID.startSession()
let startResult = NeuroID.startSession("mySessionID")

print("Started: \(startResult.started), SessionID: \(startResult.sessionID)")
NeuroID.getInstance()?.startSession()
NeuroID.getInstance()?.startSession("mySessionID")
await NeuroID.startSession()
await NeuroID.startSession("mySessionID")

startSession - Advanced Device

🚧

Requires the NeuroID Advance Device Library for each platform

Begin a new session and start sending events to NeuroID. Additionally, begin to collect Advanced Device Signals.

If a sessionID is provided it will be used, otherwise a new sessionID will be generated. Requirements for sessionID are the same for userID (see setUserID).

ParametersType
SessionIDString?
AdvancedDeviceBoolean
Returns
StartSessionResult Object
started:Boolean - Boolean signifying the command was successful or not. If false, error logs will be printed to indicate the failure reason.
sessionID:String - String of the sessionID passed in or generated by the SDK.

Failure Reasons:
Failure because no clientKey was found indicates that the configure command was not called prior.
Failure because invalid userID indicates that an invalid sessionID was passed in. See requirements under setUserID
NeuroID.startSession(nil, true)
let startResult = NeuroID.startSession("mySessionID", true)

print("Started: \(startResult.started), SessionID: \(startResult.sessionID)")
NeuroID.getInstance()?.startSession("", true)
NeuroID.getInstance()?.startSession("mySessionID", true)
await NeuroID.startSession(null, true)
await NeuroID.startSession("mySessionID", true)

pauseCollection

Pause the collection and sending of events while keeping the current session open.

Returns
Void
NeuroID.pauseCollection()
NeuroID.getInstance()?.pauseCollection()
await NeuroID.pauseCollection()

resumeCollection

Resume the collection and sending of events. Called after pauseCollection.

Returns
Void
NeuroID.resumeCollection()
NeuroID.getInstance()?.resumeCollection()
await NeuroID.resumeCollection()

stopSession

Stop the current session and stop the collecting and sending of events to NeuroID.

Returns
Void
NeuroID.stopSession()
NeuroID.getInstance()?.stopSession()
await NeuroID.stopSession()

registerPageTargets

SDK Version 3.0+: React-Native

Register all the targets on the screen and begin capturing events.

Note: See also setupPage.

Returns
Void
await NeuroID.registerPageTargets()

setupPage

SDK Version 3.0+: React-Native

Set the current Screen Name, register all targets on the page, and begin capturing events.

Note: This method is a combination of setScreenName and registerPageTargets. If used, it is not necessary to call either of the other methods.

ParametersType
ScreenNameString
Returns
Void
await NeuroID.setupPage("myScreenName")

setUserID

Set the UserID.

The UserID MUST meet all the following requirements:

  • Must be a string value
  • Must consist of only alphanumeric characters, dashes, underscores, or periods
  • Must be a minimum length of 3 characters
  • Must be a maximum length of 100 characters
  • Must not contain any PII
ParametersType
UserIDString
Returns
Boolean - Signifies if the command was successful or not. If false, error logs will be printed to indicate the failure reason. Failure would be because an invalid userID was used.
NeuroID.setUserID("myUserID")
NeuroID.getInstance()?.setUserID("myUserID")
await NeuroID.setUserID("myUserID")

setRegisteredUserID

Set the RegisteredUserID.

The UserID MUST meet all the following requirements:

  • Must be a string value
  • Must consist of only alphanumeric characters, dashes, underscores, or periods
  • Must be a minimum length of 3 characters
  • Must be a maximum length of 100 characters
  • Must not contain any PII
ParametersType
registeredUserIDString
Returns
Boolean - Signifies if the command was successful or not. If false, error logs will be printed to indicate the failure reason. Failure would be because an invalid userID was used.
NeuroID.setRegisteredUserID("myUserID")
NeuroID.getInstance()?.setRegisteredUserID("myUserID")
await NeuroID.setRegisteredUserID("myUserID")

start

Begin a new session and start sending events to NeuroID.

Note: Starting in SDK V3.1.0+startSession is used instead of start.

Returns
Boolean - Signifies if the command was successful or not. If false, error logs will be printed to indicate the failure reason. Failure would be because no clientKey was found, indicating that the configure command was not called prior.
NeuroID.start()
NeuroID.getInstance()?.start()
await NeuroID.start()

start - Advanced Device

🚧

Requires the NeuroID Advance Device Library for each platform

Begin a new session and start sending events to NeuroID. Additionally, begin to collect Advanced Device Signals.

Note: Starting in SDK V3.1.0+startSession - Advanced Device is used instead of start.

ParametersType
AdvancedDeviceBoolean
Returns
Boolean - Boolean signifying the command was successful or not. If false, error logs will be printed to indicate the failure reason. Failure would be because no clientKey was found, indicating that the configure command was not called prior.
NeuroID.start(true)
NeuroID.getInstance()?.start(true)
await NeuroID.start(true)

stop

Stop the session and stop sending events to NeuroID.

Note: Starting in SDK V3.1.0+stopSession is used instead of stop.

Returns
Void
NeuroID.stop()
NeuroID.getInstance()?.stop()
await NeuroID.stop()

What’s Next