External (publishable) Arc XP block integrating the Poool Access SDK (access.min.js). Mirrors internal feature behavior with extended fields and analytics hooks.
npm install @yourorg/poool-paywall-block
Add to blocks.json:
{
"blocks": [
"@yourorg/poool-paywall-block"
]
}- Deferred script loading (DOMContentLoaded | load | idle)
- Config precedence: Custom Field > siteProperties.poool > environment/poool.json
- Cookies toggle (
cookiesEnabled) - Advanced JSON override (
extraConfigJSONmerged into paywall) - Feature flag gating (
featureFlagKeyviasiteProperties.flags) - DOM CustomEvent + dataLayer emission
- Consent gating (
consentRequired+ global__pooolConsentGranted) - Debug helpers on
window.__pooolDebug
| Field | Description |
|---|---|
| scriptOrigin | Poool CDN base URL |
| appId | Poool Access application ID |
| enabled | Master enable/disable |
| cookiesEnabled | Maps to cookies_enabled Access config |
| deferUntil | Defer strategy: DOMContentLoaded |
| paywallTarget | Paywall widget target selector |
| contentSelector | Gated content selector |
| mode | excerpt |
| percent | Visible percent (excerpt mode) |
| pageType | premium |
| extraConfigJSON | JSON merged into paywall object |
| featureFlagKey | Optional flag key gating enablement |
| emitDomEvents | Dispatch poool:paywall-created |
| emitDataLayer | Push analytics payload |
| dataLayerName | Name of data layer array (default dataLayer) |
| consentRequired | Require consent before load |
| debug | Expose debug helpers |
If enabled:
window.addEventListener('poool:paywall-created', (e) => console.log(e.detail));
// dataLayer push example
window.dataLayer.find(v => v.event === 'poool_paywall_created');Set window.__pooolConsentGranted = false before render to block load when consentRequired true. Flip to true and call debug helper if needed:
window.__pooolConsentGranted = true;
window.__pooolDebug.ensurePooolScript(window.__pooolDebug.config);window.__pooolDebug.config
window.__pooolDebug.ensurePooolScript(...)
window.__pooolDebug.initializeAccess(...)- Bump version in package.json
npm publish --access public- Update consuming theme
blocks.json - Verify fields appear in PageBuilder
UNLICENSED (internal). Adjust if distributing publicly.