Skip to main content

Consent management

In addition to showing or hiding widget layers, the SDK lets you accept, deny, or update user consent from your own interface. These methods reuse the widget's internal flow, so they save state and trigger the corresponding consent events.

note

Use these methods only after the Lawwwing script has been initialized on the page.

Lawwwing.sdk.accept()​

Accepts all available consent categories.

Example​

// Accept all consent from a custom button
Lawwwing.sdk.accept();

Lawwwing.sdk.deny()​

Deny all optional categories and keep only the required categories active.

Example​

// Deny all optional categories
Lawwwing.sdk.deny();

Lawwwing.sdk.update(categories)​

Updates consent at a granular category level.

Parameters​

ParameterTypeDescription
categoriesobjectObject with categories to update. Each key must be a valid category and each value must be true or false.

Common Categories​

CategoryTypeDescription
technicalbooleanTechnical or strictly necessary cookies.
preferencesbooleanUser preferences and personalization.
analyticsbooleanMeasurement and analytics.
marketingbooleanAdvertising and commercial tracking.

Examples​

// Allow analytics and disable marketing
Lawwwing.sdk.update({
analytics: true,
marketing: false,
});

// Keep only required categories and preferences
Lawwwing.sdk.update({
technical: true,
preferences: true,
analytics: false,
marketing: false,
});
tip

Lawwwing.sdk.update(categories) only applies the categories included in the provided object, so you can update one or several without resending the full state.

info

The methods Lawwwing.sdk.accept(), Lawwwing.sdk.deny(), and Lawwwing.sdk.update(categories) trigger the consent flow and return control immediately. They do not wait for all integrations or subsequent processes to finish before execution continues.