Constructor
new Privacy(config, auth, context)
Create a new Privacy
object.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
Global configuration for the SDK Properties
|
||||||||||||
auth |
Object |
Auth object contains property values to authorize requests to Verify Properties
|
||||||||||||
context |
Object |
Context object contains Privacy SDK specific context Properties
|
- Source:
Members
ConsentDisplayTypes
Enumeration of different possible consent display types
Properties:
Name | Type | Description |
---|---|---|
DO_NOT_SHOW |
ConsentDisplayTypesEnum | |
TRANSPARENT |
ConsentDisplayTypesEnum | |
OPTIN_OR_OUT |
ConsentDisplayTypesEnum | |
ALLOW_OR_DENY |
ConsentDisplayTypesEnum |
- Source:
ConsentTypes
Enumeration of different possible consent types
Properties:
Name | Type | Description |
---|---|---|
ALLOW |
ConsentTypesEnum | |
DENY |
ConsentTypesEnum | |
OPTIN |
ConsentTypesEnum | |
OPTOUT |
ConsentTypesEnum | |
TRANSPARENT |
ConsentTypesEnum |
- Source:
Methods
(async) assess(items) → {Promise.<WrappedAssessment>}
Evaluate the attributes requested for approval.
Request the consent management system to approve the use of attributes for the specified purpose, access type and an optional value. If the access type is not specified, it is set to a system default.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
items |
Array |
The data items that require approval for use Properties
|
Returns:
Type | Description |
---|---|
Promise.<WrappedAssessment> |
The status of the assessment and additional details |
- Source:
Example
let r = await client.assess([
{
// allow mobile number for marketing
"purposeId": "marketing",
"attributeId": "mobile_number",
"accessTypeId": "default"
},
{
// default end user license agreement
"purposeId": "defaultEULA",
},
{
// Privacy profile identifier
"profileId": "gdprprofile",
}
])
if (r.status == "consent") {
// redirect for consent or build the page here
// and render. consider filtering out items
// in the assessment that are not approved because
// of a rule violation
} else if (r.status == "approved") {
// the world is your oyster. go forth and conquer
} else {
// examine the assessment and show an appropriate error
}
(async) getConsentMetadata(items, headers) → {Promise.<WrappedMetadata>}
Get consent metadata that can be used to build the consent page presented to the data subject/user, including the current state of consent.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
items |
Array |
The data items that require approval for use Properties
|
|||||||||||||||
headers |
Object |
Optional headers that can be sent Properties
|
Returns:
Type | Description |
---|---|
Promise.<WrappedMetadata> |
The status of the request and any consent metadata |
- Source:
Example
let r = await client.getConsentMetadata([
{
// allow mobile number for marketing
"purposeId": "marketing",
"attributeId": "mobile_number",
"accessTypeId": "default"
},
{
// default end user license agreement
"purposeId": "defaultEULA",
}
])
if (r.status == "done") {
// render the page based on the r.metadata
}
(async) getUserConsents(options) → {Promise.<WrappedGetUserConsents>}
Fetches user consents.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
Object |
An optional parameter object Properties
|
Returns:
Type | Description |
---|---|
Promise.<WrappedGetUserConsents> |
- Source:
Example
let r = await client.getUserConsents()
if (r.status == "done") {
// render the page based on the r.consents
}
(async) storeConsents(consents) → {Promise.<WrappedStoreUserConsents>}
Store consents for the user.
Consents may only be created typically, except if the consent
end time needs to be updated. Only 10 consent operations are allowed
at a time.
Parameters:
Name | Type | Description |
---|---|---|
consents |
Array.<Consent> |
The full consent records that need to be created or updated |
Returns:
Type | Description |
---|---|
Promise.<WrappedStoreUserConsents> |
Consent operation response |
- Source: