Skip to main content
ReploScripts injects managed scripts and gates each one on consent. You edit the script array, and never hand-write <script> tags for managed scripts.

consent/replo-scripts

@replohq/sdk/consent/replo-scripts

ReploScripts

The single registry component for all managed tracking scripts on the site. Authored once in app/layout.tsx; the agent/miniapp only edit the scripts array. Each entry registers itself and is gated + injected per consent. A consent-platform entry (Cookiebot, or a generic consentPlatform) takes over consent site-wide: scripts carry the platform’s blocking attributes, its loader injects after them so its startup scan sees the full set, and Replo’s own gates follow the platform instead of the native banner.
Also exported

consent/consent-store

@replohq/sdk/consent/consent-store

ConsentState

Framework-agnostic, cookie-backed consent store. Lives as a single module singleton so ReploScripts, the site’s consent banner, and AnalyticsProvider all share the same state regardless of where they sit in the React tree — no provider-ancestor relationship is required. SSR and the first hydration render use a mode: "off" snapshot, which allows every category under native consent. Irreversible consent work must wait for client hydration, when the cookie-backed snapshot is available. The whole-site mode comes from data-replo-consent-mode on <html>.

isConsentAllowed

Whether a script requiring requiredConsent may load now. mode === "off" allows everything only under Replo’s banner; a delegated CMP answers instead.
Also exported

consent/types

@replohq/sdk/consent/types Exports