Skip to main content
Requires SDK 1.1.0 or newer. See versions and deployment. Use @cookiechimp/react/platform to render the CookieChimp banner and preferences from the same JSON configuration used by the dashboard. Visitors can choose by category or individual vendor, inspect the purpose and provider, and see the cookies or storage each vendor uses. Use the connected walkthrough for backend configuration and consent delivery. The UI also accepts a saved copy of the same JSON, so you can run it without a backend request. Rendering the UI does not enable logging, load vendor tags or install script blocking automatically.

Render the platform JSON

bundle is the unchanged JSON from the platform offline/config endpoint. The provider creates the runtime and selects the banner, language, categories and vendor disclosures. Supply trusted region context from your application; the SDK makes no location lookup. Do not nest another ConsentProvider around these components. For Next.js, render this provider in a client component and pass serializable JSON from your server loader. Also pass the consent state read from the request cookie as initialState (or null for a first visit), using the same cookie name as the bundle. This lets saved choices match during server rendering and hydration without flashing the initial banner. Avoid rendering newly generated consent IDs or timestamps directly in the initial server HTML. Saved decisions are reused only while their recorded regulation matches the selected consent mode. Switching between opt-out and opt-in requires a fresh choice and applies the new mode’s defaults immediately. Legacy cookies without regulation metadata remain supported. The selected language and dir apply only to the banner, preferences and recall control. Application content inside the provider keeps its own language and text direction. A server loader can fetch and validate a bundle before rendering:
Use the public account hashid from your installation snippet, never a secret API key. Handle loading and errors in your application. Choose an appropriate server cache policy for your framework, and retain a validated local fallback if your application must operate while config is unavailable. createSync adds cached config, ETag revalidation and update handling for the core/standard providers; its dashboard result is an adapted configuration, not the raw bundle expected by PlatformConsentProvider. For an App Router page, pair that loader with the request’s consent cookie:
Keep ConsentExperience in a "use client" module. loadConsentBundle is the server loader shown above. Do not rewrite a saved record’s regulation before passing it in: the runtime must invalidate a choice made under a different law.

Keep the existing JSON keys

The provider reads banners, translations, country_banner_map and default_banner. Each category keeps its slug, name, description, required, services and storage_items. Services keep id, name, description, company, privacy_policy_url, accepted_by_default and storage_items. Storage disclosures retain name, type, description, duration and company. Nested translations supply localized content. The SDK derives runtime service keys, such as google-analytics, while retaining the original platform IDs in the adapter. Do not add consent_key or a second vendor schema to the JSON. The complete field compatibility matrix describes the supported inputs and integration boundaries. Category switches update their vendors. A vendor can be changed individually when control_level is category_and_services. Changes remain staged until Save preferences; Close discards them. Accept and Reject apply immediately. Required categories and their vendors stay enabled, and GPC cannot be bypassed by a vendor override. Rich descriptions preserve supported formatting and safe links without injecting raw HTML. Use the regular hooks inside PlatformConsentProvider:
Runtime snapshots and decision callbacks always include a complete services object. Each configured vendor has its effective boolean value before and after a decision; no configured services means {}. For example, an opt-in setup can start with:
These values match hasService(): required vendors are enabled, and optional vendors follow category defaults, saved individual choices and GPC. Displaying this state does not save a decision or send a consent log. Older sparse cookies are accepted, and inherited defaults remain separate from explicit vendor choices in storage so category changes continue to apply. The preferences modal shows Your consent ID above the attribution. This is the runtime consentId, also serialized as uuid by the platform consent-log adapter. It persists with saved consent. It is not a backend delivery receipt. Translate the label when needed:

Motion and accessibility

The platform stylesheet includes entrance, disclosure and switch transitions. Animations are enabled by default and automatically respect reduced motion. Disable them for the provider without another package:
Preferences trap focus, support Escape and restore focus to the trigger. The header and actions stay visible while only the body scrolls. Collapsed vendor details are inert and excluded from keyboard navigation. Headless applications can use @cookiechimp/react/headless and supply their own styling. Pass an onConsent callback to PlatformConsentProvider and send decisions with createConsentLog from @cookiechimp/core/consent-log when connecting to CookieChimp. Configure the public account ID, selected banner ID and service category mapping from adaptPlatformConfig(bundle, ...). Keep the log instance stable, call record(record, language) for each decision, and destroy it when its owning application is torn down. See the connected example for receipt reconciliation, retry handling and cleanup. A successful config request, a displayed consent ID or an empty queue is not proof of delivery. Confirm a matching client_id in the backend’s synced receipt. Use the generic endpoint integration only for your own receiver, not for the platform’s batch sync endpoint. Google Consent Mode, script/iframe blocking, GPP and TCF retain their explicit integrations; platform flags do not install them by rendering this UI.

Try all variations

The React/Vite example includes a playground at /platform.html:
Open http://127.0.0.1:3104/platform.html. The 16 presets cover all seven layout/button combinations plus vendor choices, category-only choices, a dark side panel, opt-out, Arabic/RTL, branding, a minimal notice, forced interaction and motion off. Fine-tune positions, button visibility, colors, themes, languages, logos and recall settings. Desktop/mobile previews render the actual SDK in an isolated frame from the same JSON shown by Inspect the platform JSON. Replay banner clears only the isolated one-hour demo cookie. Reload saved choices retains it to test persistence. Open the preview in a full page or copy the JSON for inspection. Vendor names and cookie details are illustrative; no vendor tags or consent records are sent by this playground. Use /connected for real backend configuration and delivery testing.