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.
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​
| Parameter | Type | Description |
|---|---|---|
categories | object | Object with categories to update. Each key must be a valid category and each value must be true or false. |
Common Categories​
| Category | Type | Description |
|---|---|---|
technical | boolean | Technical or strictly necessary cookies. |
preferences | boolean | User preferences and personalization. |
analytics | boolean | Measurement and analytics. |
marketing | boolean | Advertising 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,
});
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.
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.