|
| 1 | +--- |
| 2 | +group: compliance |
| 3 | +title: Adobe Privacy JavaScript Library |
| 4 | +--- |
| 5 | + |
| 6 | +The [Adobe Privacy JavaScript Library][] is a set of tools to help create a process for accessing and deleting private data. |
| 7 | + |
| 8 | +Magento and Adobe's data tracking services can store private information applicable to privacy regulations such as the [General Data Protection Regulation (GDPR)][] and [California Consumer Privacy Act (CCPA)][]. |
| 9 | +This library provides a unified set of functions for creating privacy-data requests, sending them to each product's implementations, and gathering the responses. |
| 10 | +Use this library to retrieve and remove the data stored in the browser by these data tracking services. |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +Use one of the following methods to download the library file: |
| 15 | + |
| 16 | +- npm: `npm install @adobe/adobe-privacy` |
| 17 | +- GitHub: <https://github.com/Adobe-Marketing-Cloud/adobe-privacy> |
| 18 | + |
| 19 | +After you have the file, you will need to add it to a custom module or theme installed in your Magento instance. |
| 20 | +Follow the instructions described in the [Use custom JavaScript][] topic to accomplish this task. |
| 21 | + |
| 22 | +## Usage |
| 23 | + |
| 24 | +The AdobePrivacy JS Library provides various functions to manage identity data stored in the browser. |
| 25 | + |
| 26 | +`retrieveIdentities()` |
| 27 | +: Returns an array of identities from a service along with an array of identities not found in the service |
| 28 | + |
| 29 | +`removeIdentities()` |
| 30 | +: Removes identities from the browser and returns an array of identity objects with a `isDeleteClientSide` boolean property to indicate whether the data has been deleted. |
| 31 | + |
| 32 | +`retrieveThenRemoveIdentities()` |
| 33 | +: This function is similar to `removeIdentities()` in that it retrieves an array of identities and removes them from the browser. |
| 34 | + |
| 35 | +For more information and examples for using these functions, see the [official library documentation][Adobe Privacy JavaScript Library]. |
| 36 | + |
| 37 | +### Initialization |
| 38 | + |
| 39 | +Instantiate a new `AdobePrivacy` object to use the AdobePrivacy JS Library in your implementation code. |
| 40 | + |
| 41 | +```js |
| 42 | +var adobePrivacy = new AdobePrivacy({}); |
| 43 | +``` |
| 44 | + |
| 45 | +The constructor accepts a configuration object with parameters during instantiation. |
| 46 | +Refer to the [official library documentation][Adobe Privacy JavaScript Library] for a list of these configuration parameters. |
| 47 | + |
| 48 | +[Adobe Privacy JavaScript Library]: https://www.adobe.io/apis/experienceplatform/gdpr/services/allservices.html#!api-specification/markdown/narrative/gdpr/use-cases/adobe-privacy-library.md |
| 49 | + |
| 50 | +[General Data Protection Regulation (GDPR)]: <{{ site.baseurl }}/compliance/privacy/gdpr.html> |
| 51 | +[California Consumer Privacy Act (CCPA)]: <{{ site.baseurl }}/compliance/privacy/ccpa.html> |
| 52 | +[Use custom JavaScript]: <{{ site.baseurl }}/guides/v2.3/javascript-dev-guide/javascript/custom_js.html> |
0 commit comments