Deprecated
User Status
getDisabledPurposes
Removed since version 2.0.0, use getCurrentUserStatus instead.
The result of this method has been replaced by getUserStatus().purposes.consent.disabled.
getDisabledPurposeIds
Removed since version 2.0.0, use getCurrentUserStatus instead.
The result of this method has been replaced by getUserStatus().purposes.consent.disabled.
getDisabledVendors
Removed since version 2.0.0, use getCurrentUserStatus instead.
The result of this method has been replaced by getUserStatus().vendors.consent.disabled.
getDisabledVendorIds
Removed since version 2.0.0, use getCurrentUserStatus instead.
The result of this method has been replaced by getUserStatus().vendors.consent.disabled.
getEnabledPurposes
Removed since version 2.0.0, use getCurrentUserStatus instead.
The result of this method has been replaced by getUserStatus().purposes.global.enabled.
getEnabledPurposeIds
Removed since version 2.0.0, use getCurrentUserStatus instead.
The result of this method has been replaced by getUserStatus().purposes.global.enabled.
getEnabledVendors
Removed since version 2.0.0, use getCurrentUserStatus instead.
The result of this method has been replaced by getUserStatus().vendors.consent.enabled.
getEnabledVendorIds
Removed since version 2.0.0, use getCurrentUserStatus instead.
The result of this method has been replaced by getUserStatus().vendors.consent.enabled.
getUserConsentStatusForPurpose
Deprecated, use getCurrentUserStatus instead.
Search the purposeId in getUserStatus().purposes.consent.enabled or getUserStatus().purposes.consent.disabled.
Get the user consent status for a given purpose. You must also check that the user has given consent to a vendor before being able to load a vendor.
Parameters
purposeId
string
The ID of the purpose to check the user consent for
Returns
A Promise<boolean> that indicates if the user has given consent or not to the specific purpose.
undefined is returned if the consent status is not known yet. From a GDPR perspective, you'll want to treat undefined as false (ie no consent given) but it is helpful to know that the user has not interacted with the consent UI yet so that you can subscribe to events and wait for consent information to be collected.
If consent is not required because GDPR does not apply to that user, this function will return true.
Example
getUserConsentStatusForVendor
Removed since version 2.0.0, use getCurrentUserStatus instead.
Search the vendorId in getUserStatus().vendors.consent.enabled or getUserStatus().vendors.consent.disabled.
getUserConsentStatusForVendorAndRequiredPurposes
Removed since version 2.0.0, use getCurrentUserStatus instead.
Search the purposeId in getUserStatus().vendors.global_consent.enabled or getUserStatus().vendors.global_consent.disabled.
getUserLegitimateInterestStatusForPurpose
Removed since version 2.0.0, use getCurrentUserStatus instead.
Search the purposeId in getUserStatus().purposes.legitimate_interest.enabled or getUserStatus().purposes.legitimate_interest.disabled.
getUserLegitimateInterestForVendor
Removed since version 2.0.0, use getCurrentUserStatus instead.
Search the vendorId in getUserStatus().vendors.legitimate_interest.enabled or getUserStatus().vendors.legitimate_interest.disabled.
getUserLegitimateInterestStatusForVendorAndRequiredPurposes
Removed since version 2.0.0, use getCurrentUserStatus instead.
Search the vendorId in getUserStatus().vendors.global_legitimate_interest.enabled or getUserStatus().vendors.global_legitimate_interest.disabled.
getUserStatus
Deprecated, use getCurrentUserStatus instead.
Get all the user consent status.
Returns
A UserStatus object describing all the available and computed user information.
purposes.global.disabled
string[]
Computed sets/lists of disabled IDs of purposes that have been chosen by the user regarding the consent or legitimate interest Legal Basis.
purposes.global.enabled
string[]
Computed sets/lists of enabled IDs of purposes that have been chosen by the user regarding the consent or legitimate interest Legal Basis. Purposes considered as essential will be part of the enabled IDs.
purposes.consent.disabled
string[]
Disabled IDs of purposes that have been explicitly chosen by the user regarding the consent Legal Basis.
purposes.consent.enabled
string[]
Enabled IDs of purposes that have been explicitly chosen by the user regarding the consent Legal Basis.
purposes.legitimate_interest.disabled
string[]
Disabled IDs of purposes that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.
purposes.legitimate_interest.enabled
string[]
Enabled IDs of purposes that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.
purposes.essential
string[]
IDs of purposes that are considered essential.
vendors.global.disabled
string[]
Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the consent or legitimate interest Legal Basis. This takes into account the consent and legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.
vendors.global.enabled
string[]
Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the consent or legitimate interest Legal Basis. This takes into account the consent and legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.
vendors.global_consent.disabled
string[]
Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the consent Legal Basis. This takes into account the consent required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.
vendors.global_consent.enabled
string[]
Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the consent Legal Basis. This takes into account the consent required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.
vendors.global_legitimate_interest.disabled
string[]
Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the legitimate interest Legal Basis. This takes into account the legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.
vendors.global_legitimate___interest.enabled
string[]
Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the legitimate interest Legal Basis. This takes into account the legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.
vendors.consent.disabled
string[]
Disabled IDs of vendors that have been explicitly chosen by the user regarding the consent Legal Basis.
vendors.consent.enabled
string[]
Enabled IDs of vendors that have been explicitly chosen by the user regarding the consent Legal Basis.
vendors.legitimate_interest.disabled
string[]
Disabled IDs of vendors that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.
vendors.legitimate_interest.enabled
string[]
Enabled IDs of vendors that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.
user_id
String
Didomi user id.
created
String
User choices creation date.
updated
String
User choices update date.
consent_string
String
TFC consent as string.
Example
getUserStatusForVendor
Removed since version 2.0.0, use getCurrentUserStatus instead.
Search the vendorId in getUserStatus().vendors.global.enabled or getUserStatus().vendors.global.disabled.
setUser
Deprecated, use setUserWithParameters instead.
Set custom user information from organization
Parameters
Name
organizationUserId
string
Organization ID to associate with the user
Returns
Nothing
Example
setUser
Deprecated, use setUserWithParameters instead.
Set custom user information from organization, with optional authentication parameters.
Name
organizationUserId
string
No
Organization ID to associate with the user
organizationUserIdAuthAlgorithm
string
Yes
Algorithm used for computing the digest
organizationUserIdAuthSid
string
Yes
ID of the secret used for computing the digest
organizationUserIdAuthSalt
string
Yes
Salt used for computing the digest (optional)
organizationUserIdAuthDigest
string
Yes
Digest of the organization user ID and secret
Returns
Nothing
Example
setUserStatusSets
Set the user status for purposes and vendors. This function will trigger events and API calls every time it is called (and the user status changes) so make sure to push all user choices at once and not one by one.
Please read our article on what to expect from your analytics when setting a custom behavior for your consent notice.
Parameters
enabledConsentPurposeIds
string[]
List of purpose IDs that the user has given consent to
disabledConsentPurposeIds
string[]
List of purpose IDs that the user has not given consent to
enabledLIPurposeIds
string[]
List of purpose IDs that the user has allowed legitimate interest processing to
disabledLIPurposeIds
string[]
List of purpose IDs that the user has disallowed legitimate interest processing to
enabledConsentVendorIds
string[]
List of vendor IDs that the user has given consent to.
Prefix custom vendor IDs with c:.
disabledConsentVendorIds
string[]
List of vendor IDs that the user has not given consent to
enabledLIVendorIds
string[]
List of vendor IDs that the user has allowed legitimate interest processing to.
Prefix custom vendor IDs with c:.
disabledLIVendorIds
string[]
List of vendor IDs that the user has not allowed legitimate interest processing to
Returns
Promise<boolean>
true if the user choices have changed (i.e. the user had made different choices before this function got called).
Example
Last updated