#Installation

The Access.js script is a hosted script that will be used to display walls inside your page.
In order to display a wall inside your page, it is important to add the necessary html content in which your wall will be added.
You can add any id or any class you want to the container (#poool-widget being the default selector used to retrieve it), as long as you specify it later inside the .createPaywall method:
Additionally, as you may want to lock some premium content inside your page, you should also add a custom id/class to the container wrapping your premium content inside your page:
Historically, the data-poool (representing the % of text you wanted to lock) and data-poool-mode (representing the locking mode) attributes were used to retrieve the content to be locked. This is not mandatory anymore and will only be used when the content property within the .createPaywall method is not provided.

#Load the script

Once your html is ready to receive a paywall, you can add the tag itself. Like any script out there, the Access.js script can be loaded in a lot of different ways.
We will purposely not cover the React implementation here as we already manage everything automatically for you in @poool/react-access.

ℹ️ If you are using Content Security Policies on your site, make sure to add https://*.poool.fr (or the api, assets and cdn subdomains if you are not comfortable with wildcards) to your whitelist in order for the paywall to operate normally.

While sync mode is easier to read and use, we recommend using async mode to avoid any unwanted side effects to your browser when the script is loading.

#Retrieve user consent

As part of the latest regulations in Europe regarding user consent, you have to provide the information to Access.js that the visitor explicitly consented to allow the _poool cookie to exist in order to allow the paywall to operate normally.
This is done through the cookies_enabled configuration key.
Depending on your Consent Management Platform provider, the method to retrieve the consent might differ. Here are a few examples:

Now that everything is set up, you can look out for the right configuration that fits your needs.