This repository contains everything (and more!) that's required to integrate Consentua into web pages.
There are two use cases for integrating with Consentua:
- Using Consentua to obtain consent as part of a user journey
- Building new interactions for obtaining consent
See index.html, which includes examples and documentation for deploying Consentua on a webpage. Importantly, you do NOT need to clone this repository!
To build custom consent interactions/interfaces, see the example provided in ui-simple which is heavily commented. You can load the javascript libraries (consentua-interaction.js, and comms.js) directly from websdk.consentua.com
- Host your interaction on a web server, it's OK if this is only available locally.
- Use the normal process to embed a consentua template into another web page, but pass an "ix" argument via the args option of the ConsentuaUIWrapper. That argument should be the URL of the interaction, something like
{ix: "http://127.0.0.1:8080/my-interaction/"}
- Load the embedding page in a web browser. The live consentua service (or test/development, depending on which mebed library you've loaded) will embed the interaction that you've specified via the ix argument, rather that the one that the specified template is usually bound to.
Once complete, you'll need to contact support to have your custom interaction verified and made available for you to bind to consent templates in your Consentua account.
For development, this whole codebase can be run locally. The API that's used is auto-detected based on server hostname, as follows. Different loopback addresses (127.0.0.x) make it easy to switch between APIs while testing locally.
Server Hostname | API |
---|---|
websdk.consentua.com | production |
127.0.0.3 | production |
websdk-test.consentua.com | test |
127.0.0.1 | test |
websdk-dev.consentua.com | development |
127.0.0.2 | development |