Skip to content

Setup and Installation

The Secure Privacy React Native SDK enables consent management across Android and iOS using a single TypeScript API. It helps your app stay compliant with privacy regulations while providing users with full control over their data preferences.

To use the Secure Privacy Consent Management SDK, you need an Application ID.
Sign up for a free trial at Secure Privacy to get your Application ID.

To initialize the SDK, call the following method with your applicationId in your main application code (e.g., inside your root component or App.js).

You may also include secondaryApplicationId, which is an optional parameter used to display a secondary consent banner in your app:

const result = await SPConsentEngine.initialiseSDK({
android: new SPAuthKey({
applicationId: 'YOUR_ANDROID_APPLICATION_ID',
secondaryApplicationId: 'YOUR_SECONDARY_ANDROID_APPLICATION_ID'
}),
ios: new SPAuthKey({
applicationId: 'YOUR_IOS_APPLICATION_ID',
secondaryApplicationId: 'YOUR_SECONDARY_IOS_APPLICATION_ID'
}),
});
if(result.code == 200) {
const spConsentEngine = result.data;
// SDK initialised successfully!
}

This will set up and initialise the SDK with your provided applicationId(s) and enable access to its features using the spConsentEngine instance.