@pactconsent/runtime
v0.3.3
Published
Pact consent runtime - inline bootstrap and async module
Maintainers
Readme
@pactconsent/runtime
Pact's performance-budgeted first-party consent runtime.
The package contains browser assets rather than a server-side framework API:
@pactconsent/runtime/inline.min.js— inline before optional tags@pactconsent/runtime/pact.js— serve asynchronously from the customer's origin@pactconsent/runtime/critical.min.css— the managed UI's embedded critical styles
Copy the assets into the application's public output, then render the inline bootstrap before any optional analytics or advertising code:
<script id="pact-bootstrap" data-tenant="site_123" data-src="/pact.js" data-api="/v1">
<!-- exact contents of inline.min.js -->
</script>The package intentionally leaves delivery under the application's first-party origin. window.pact exposes readiness, purpose decisions, GPC state, change listeners, allow/deny actions, and preference opening.
Run pnpm --filter @pactconsent/runtime size in the Pact repository to enforce the bootstrap, Brotli, and critical-CSS budgets.
