@biscotti-cmp/react-native
v1.0.1
Published
Biscotti CMP React Native SDK — native consent management with IAB TCF 2.3 (CMP ID 497)
Maintainers
Readme
Biscotti CMP — React Native SDK
React Native consent-management SDK for Biscotti CMP, with IAB TCF 2.3 support (CMP ID 497) and consent-gated SDK initialisation. This package is a thin bridge over the native iOS and Android SDKs.
- Package:
@biscotti-cmp/react-native· RN: >= 0.72 · React: >= 18
Installation
npm install @biscotti-cmp/react-native
# iOS
cd ios && pod installNative dependencies. This bridge depends on the native SDKs, both resolved automatically (no auth):
- iOS: the
BiscottiCMPCocoaPod (via the podspec).- Android:
com.biscotti-cmp:biscotti-androidfrom Maven Central.
Usage
import { BiscottiCMP } from '@biscotti-cmp/react-native';
// Configure early (positional args; apiKey optional)
await BiscottiCMP.configure('YOUR_WEBSITE_ID', 'OPTIONAL_API_KEY');
// Gate third-party SDKs behind consent
BiscottiCMP.registerSDK({
name: 'firebase_analytics',
category: 'analytics',
initializer: () => {/* init Firebase */},
});
// Read consent (async — bridged to native)
const granted = await BiscottiCMP.hasConsent('marketing');
const tcString = await BiscottiCMP.getConsentToken();Consent categories: 'essential' | 'functional' | 'analytics' | 'marketing'.
TCF 2.3
The underlying native SDKs emit a spec-compliant IAB TC string (CMP ID 497, policy version 5, service-specific) derived from your per-site Biscotti configuration.
License
MIT — see LICENSE.
