Skip to main content

Banner and documents

Requirement

The Lawwwing script must be loaded on the page. See the SDK reference to learn how to integrate it.

In Lawwwing, user consent is managed through a layered system that enables a more flexible experience.

  • Layer 1: Main consent banner. This is the initial message that informs the user about cookie usage and asks them to accept or configure their preferences.
  • Layer 2: Advanced settings panel. This allows the user to choose in more detail which cookie categories they want to accept or reject.

The Lawwwing SDK provides public methods to manually show or hide these layers, which is ideal if you want to control the user experience from your application or website.

Lawwwing.sdk.show(layer)​

This method lets you manually display one of the consent banner layers.

Parameters​

ParameterTypeDescription
layerintLayer number to show. Use 1 for the first layer and 2 for the settings panel.

Examples​

// Show the first layer: Consent banner
Lawwwing.sdk.show();
// Show the first layer: Consent banner
Lawwwing.sdk.show(1);
// Show the second layer: Advanced settings
Lawwwing.sdk.show(2)

Lawwwing.sdk.hide(layer)​

This method lets you manually hide one of the consent banner layers.

Parameters​

ParameterTypeDescription
layerintLayer number to hide. Use 1 for the main banner and 2 for the settings panel.

Examples​

// Hide the first layer: Consent banner
Lawwwing.sdk.hide();
// Hide the first layer: Consent banner
Lawwwing.sdk.hide(1);
// Hide the second layer: Advanced settings
Lawwwing.sdk.hide(2)
tip

You can combine these methods with SDK events or custom buttons in your interface to provide a smoother and more user-friendly consent experience.

Lawwwing.sdk.document(document)​

This method lets you access Lawwwing documents from your application or website.

You can use it to display any document that is active in your Lawwwing account.

warning

For the viewer to work properly, you must have an active subscription in your Lawwwing account.

Parameters​

ParameterTypeDescription
documentstringType of document to display. Options: notice privacy terms, cookies, or purchase.
tip

The available document types may vary depending on your subscription plan.

Examples​

// Open legal notice
Lawwwing.sdk.document('notice').open();
// Close legal notice
Lawwwing.sdk.document('notice').close();
// Open privacy policy
Lawwwing.sdk.document('privacy').open();
// Close privacy policy
Lawwwing.sdk.document('privacy').close();