## HumanConnect.open argument properties
Before invoking the function `HumanConnect.open(options)
` to launch Connect, you can supply the following parameters for the options object argument:
Attribute | Description |
clientId | Your application's `clientId `. If you don't have one, please reach out to open a developer account |
clientUserId | Can be an email address or any UTF-8 string to identify the user |
token | (**required**) Session token initially retrieved from Human API's authentication service |
onClose | A Javascript function with this signature: `function close(response){...} ` |
onConnectSource | A Javascript function with this signature: `function (response){...} ` |
onDisconnectSource | A Javascript function with this signature: `function (response){...} ` |
## Human Connect session response during user activity
After the user adds or removes data sources and closes Connect, your `onClose
` callback will be invoked with a response argument. The response object is as follows:
Property | Type | Description |
status | String | Identifies whether the session terminated normally (`SUCCESS `) or abnormally : `SESSION_TOKEN_INVALID `, `SESSION_TOKEN_EXPIRED ` or `MISSING_SESSION_TOKEN ` |
sessionResults | Object | Identifies details about the data sources which the user connected or disconnected |
sessionResults.connectedSources | Array[Object] | Identifies data sources connected by the user during the session. The array can be empty if the user did not connect any source |
sessionResults.disconnectedSources | Array[Object] | Identifies data sources disconnected by the user during the session. The array can be empty if the user did not disconnect any source |
currentConnections | Array[Object] | Identifies active data sources for the user, including sources which were connected in previous sessions |
See below for an example response:
Does the response payload look different for onConnectSource and onDisconnectSource?
The main difference lies in the "response.status". When onConnectSource is invoked, "response.status"="CONNECTED_SOURCE". When onDisconnectSource is invoked, "response.status"="DISCONNECTED_SOURCE".