
Security News
Critical Security Vulnerability in React Server Components
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.
@didomi/react-native
Advanced tools
Didomi is a leading Consent Management Platform that allows companies to collect, store, and leverage user consent under GDPR, CCPA, and other data privacy regulations. This plugin enables React Native developers to get in compliance and optimize their consent rate and monetization on native mobile apps.
This repository contains the source code and a sample app for the Didomi React Native plugin. This plugin enables React Native developers to easily use Didomi's Consent Management Platform on Android and iOS apps.
Install using yarn add @didomi/react-native
Or npm i @didomi/react-native
Then install required pods for iOS with cd ios && pod install
As Didomi requires Swift runtime for iOS, you may need to add an empty Swift file (to create a briding header) into Xcode project.
import { Didomi, DidomiEventType } from '@didomi/react-native';
import { useEffect } from 'react';
// ...
function App() {
useEffect(() => {
// Initialize and setup UI
// The initialize function need to be called only once and as early as possible to give time for the SDK initialization
Didomi.initialize('YOUR_API_KEY', undefined, undefined, undefined, false, undefined, 'YOUR_NOTICE_ID');
// The setupUI displays the popup and is only available once the SDK sent the onReady events
Didomi.setupUI();
}, [])
return (
<SafeAreaView style={{ flex: 1 }}>
// ...
</SafeAreaView>
);
}
//...
// Retrieve data
const purposes = await Didomi.getEnabledPurposes();
const status = await Didomi.getUserStatusForVendor('vendorId');
//...
// Register an event listener
Didomi.addEventListener(DidomiEventType.SHOW_NOTICE, () => {
console.log('Show notice');
});
//...
For a complete overview of available methods and events, have a look at the online documentation.
In case you need to use a local configuration. The didomi_config.json must be added to native iOS and Android projects.
On iOS, drag and drop the file to Xcode files.
On Android, copy it to the src/main/assets folder.
For complete instructions on installing and using the plugin, please read our documentation:
Sources contain 2 applications: /test (an app designed mostly for UI testing ) and /sample (more human friendly app).
They can be run with:
# test or sample Application
cd sample
cd ios && pod install
cd ..
npx react-native run-ios
# or npx react-native run-android
To file bugs, make feature requests, or to suggest other improvements, please use Github's issue tracker.
Modified BSD License (BSD-3)
FAQs
Didomi React Native SDK
The npm package @didomi/react-native receives a total of 2,912 weekly downloads. As such, @didomi/react-native popularity was classified as popular.
We found that @didomi/react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.

Research
/Security News
We spotted a wave of auto-generated “elf-*” npm packages published every two minutes from new accounts, with simple malware variants and early takedowns underway.

Security News
TypeScript 6.0 will be the last JavaScript-based major release, as the project shifts to the TypeScript 7 native toolchain with major build speedups.