Go Headless

Changelog

SDK
Articles
Get Started
Work with the SDK
Set up a Client
Use the Wix MCP

Core Modules
About Core Modules
sdk
essentials
web-methods

Host Modules
About Host Modules
dashboard
editor
site

Business Solutions
About Business Solutions
ai-site-chat
blog
bookings
cache
crm
data
ecom
events
restaurants
stores
realtime

Frontend Modules
About Frontend Modules
bookings
crm
ecom
events
location
members
mobile
navigate-mobile
pay
pricing-plans
seo
site
storage
stores
window
Introduction
Setup
App Page Data
browserLocale()
copyToClipboard()
formFactor()
getAppPageData()
getBoundingRect()
getCurrentGeolocation()
getRouterData()
openLightbox()
openModal()
postMessage()
referrer()
registerEventListener()
scrollBy()
scrollTo()
trackEvent()
viewMode()
ConsentPolicy
getCurrentConsentPolicy()
onConsentPolicyChanged()
resetConsentPolicy()
setConsentPolicy()
Lightbox
Multilingual
Rendering
WarmupData
site-realtime

getCurrentConsentPolicy( )


Deprecated

This method is deprecated.

Deprecated. This method will continue to work, but a newer version is available. Use the getCurrentConsentPolicy() method instead.

Migration Instructions

If this method is already in your code, it will continue to work. To stay compatible with future changes, migrate to getCurrentConsentPolicy().

To migrate to the new method:

  1. Add the new import statement:

    Copy
  2. If you plan to migrate all methods that use getCurrentConsentPolicy(), remove the original import { consentPolicy } from "wix-window-frontend"; statement.

  3. Look for any code that uses consentPolicy.getCurrentConsentPolicy(), and replace it with the new import. Update your code to work with the new getCurrentConsentPolicy() call and response properties.

  4. Test your changes to make sure your code behaves as expected.

Note: Check the new method documentation for any differences in parameters, return values, or behavior compared to the deprecated getCurrentConsentPolicy() method.

Gets the site visitor's consent policy regarding allowed cookies and 3rd-party data transfers for GDPR or CCPA compliance.

Retrieves the site visitor's consent policy details, including which cookies are allowed and whether data transfer to 3rd parties is permitted.

Method Declaration
Copy
Request
This method does not take any parameters
Returns
Return Type:Promise<PolicyDetails>
Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?