> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kontext.so/llms.txt
> Use this file to discover all available pages before exploring further.

# TCF & CMP

> How the Video SDK reads IAB TCF v2.2 consent from your CMP automatically, and how to set consent yourself.

## TCF

The **IAB Transparency and Consent Framework (TCF)** is the EU and UK ad-tech standard for collecting and propagating GDPR consent. Publishers display a consent dialog, the viewer picks what they're OK with, and the result is encoded into a **TCF v2.2 consent string**. Every downstream ad partner, Kontext included, reads that string to know what it may do with the viewer's data.

## CMP

A **Consent Management Platform (CMP)** is the tool that shows the consent dialog and produces the TCF string. The CMP writes the string to a well-known storage location that every TCF-compatible SDK can read.

If your app serves EU or UK viewers, you need a CMP:

* **GDPR and the UK Data Protection Act require explicit consent** for personalized advertising. Without a CMP you can't legally collect it.
* **Without a valid TCF string, fill rate drops.** Most advertisers won't bid on traffic with no consent signal, or bid only for the lowest-priced contextual inventory.
* **It's the publisher's responsibility.** The Video SDK ships no consent dialog; you integrate a CMP yourself.

Any IAB-registered CMP works: OneTrust, Sourcepoint, Usercentrics, Didomi, and others.

## The SDK reads TCF automatically

Once a TCF-compliant CMP is integrated and the viewer has answered the prompt, the SDK reads the consent string through the standard IAB-defined storage on each platform: `UserDefaults` keys on iOS (`IABTCF_TCString`, `IABTCF_gdprApplies`, …), `SharedPreferences` on Android. You don't forward anything; every ads request carries the current values.

## Setting consent yourself

Without a CMP, or for signals outside TCF, set `regulatory` on the shared instance. Every field is optional; the next request carries what you set, and a value from your CMP wins over a value set here.

```swift theme={null}
KontextVideo.shared.regulatory = .init(
    gdpr: true,
    gdprConsent: "<TCF string>",
    coppa: false,
    gpp: "<GPP string>",
    gppSid: [7],
    usPrivacy: "1YNN"
)
```

* **No CMP yet**: set `gdpr` and `gdprConsent` until you wire one up.
* **COPPA**: set `coppa: true` for child-directed traffic. TCF doesn't cover it, and the device can't tell.
* **US privacy and GPP**: `usPrivacy`, `gpp` and `gppSid` for US state regulations.

See [Compliance](https://docs.kontext.so/video/resources/compliance.md) for the full picture.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.