@truconsent/consent-notice-react-native
v0.1.0
Published
React Native SDK for TruConsent consent banner
Readme
@truconsent/consent-notice-react-native
React Native SDK for TruConsent consent banner. This package provides native mobile UI components for displaying and managing consent banners in React Native applications.
Installation
npm install @truconsent/consent-notice-react-native
# or
yarn add @truconsent/consent-notice-react-nativePeer Dependencies
This package requires the following peer dependencies:
react>= 18.0.0react-native>= 0.70.0react-i18next>= 16.2.3i18next>= 25.6.0
Usage
import { TruConsentModal } from '@truconsent/consent-notice-react-native';
function App() {
return (
<TruConsentModal
apiKey="your-api-key"
organizationId="your-org-id"
bannerId="your-banner-id"
userId="user-id"
onClose={(action) => console.log('Consent action:', action)}
/>
);
}API
TruConsentModal
Main component for displaying the consent banner modal.
Props
apiKey(string, required): API key for authenticationorganizationId(string, required): Organization IDbannerId(string, required): Banner/Collection Point IDuserId(string, required): User ID for consent trackingapiBaseUrl(string, optional): Base URL for APIlogoUrl(string, optional): Company logo URLcompanyName(string, optional): Company nameonClose(function, optional): Callback when modal closes
License
MIT
