It would be awesome for dynamic integrations to have some API method that we can call to tell Consent Pro to recheck the page for updates. For example for iframes that are added later by external APIs. Right now it does only scan the DOM on page load as it seems and this requires a lot of manual code set up. Instead just calling something like “window.FinsweetConsentPro.init()” or “.check()” could fix that…
Hey @vierless_julian!
To be upfront with you — a dedicated rescan or reinitialize method like window.FinsweetConsentPro.init() or .check() doesn’t currently exist in the Consent Pro v2 API.
The current public API covers consent management (get, set, acceptAll, rejectAll, renew), UI controls for the banner and preferences panels, and a destroy() method in the Lifecycle API. There’s no supported destroy-then-reinitialize pattern either, so that path would break consent management rather than solve it.
That said, there are a couple of things that might be partially relevant depending on your exact scenario:
- DOM events — Consent Pro dispatches
consentpro:*prefixed events on the document element, includingiframe-blockedandiframe-unblockedevents with payloads containing the element reference and consent categories. - push() callback — You can hook into the consent lifecycle via
window.FinsweetConsentPro.push(...)for custom logic post-initialization.
Could you share a bit more about your setup?
For example — are the iframes being injected by a third-party widget or API, or is this more of a dynamic rendering scenario like SPA-style navigation, Webflow Interactions, etc.? That context would help us figure out whether the existing event hooks could cover your use case, or if this is a genuine feature gap.
Either way, we’ll flag this to our product team as a feature request. A .rescan() or .check() method for dynamically added elements is a solid idea and worth pushing for.