Entities

What is an entity?

The point here, is to list all your entities with which you will interact in the back-end, regarding of their types.

An entity can be a purpose, a preference and a channel. There is no difference in the structure but those 3 types of entities will have different usage in the containers and the components objects. It will allow you to create consents up to 3 levels. Keep in mind that a purpose can contain multiple preferences and a preference can contains multiple channels. If you phrase it differently, a channel will need to be linked to preference and a preference to a purpose.

Only purposes are required in your configuration.

Where do I add my entities?

An entity object needs to be added in the entities array of the didomiConfig object and contains 3 attributes to be configured properly:

window.didomiConfig = {
entities: [
{
id: "PURPOSE_1_ID",
name: "Purpose 1",
description: ""
},
{
id: "PREFERENCE_1_ID",
name: "Preference 1",
description: ""
}
],
containers: [...]
};

Props

Name

Type

Description

id

String

ID of the entity. It will be used to link the entities together in the containers section and to link them to components if the components section

name

String|Object

Name of the entity. If can be either a string or an object if you need to handle translations. See this section for more information

description

String|Object

Description of the entity. If can be either a string or an object if you need to handle translations. See this section for more information

Translation support

name and description can be either a regular string or an object if you need to handle translations.

window.didomiConfig = {
...
entities: [
{
id: "PURPOSE_ID",
name: {
en: "English content",
fr: "Contenu en Français"
}
}
],
containers: [...]
};
EN => English content
FR => Contenu en Français

You can manage the desired languages in the Didomi configuration object. See this section for more information

Example

In the case where you have :

Two purposes:

  • analytics

  • social_media

Each purpose contains the same preference:

  • commercial_communication

For analytics, commercial_communication , we want to display 3 channels

  • email

  • text

  • call

For social_media , commercial_communication , we want to display only one channel

  • email

The list of entities would be :

window.didomiConfig = {
...
entities: [
{
id: "analytics",
name: "Analytics"
},
{
id: "social_media",
name: "Social Media"
},
{
id: "commercial_communication",
name: "Commercial communication"
},
{
id: "email",
name: "Email"
},
{
id: "text",
name: "Text"
},
{
id: "call",
name: "Call"
},
],
containers: [...]
};