Learn more about integrating Cashfree SDK in your react native application
Cashfree’s react native DigiLocker SDK allows you to seamlessly integrate DigiLocker-based identity verification into your mobile application. With this SDK, you can securely initiate DigiLocker flows, collect user consent, and retrieve verified government-issued documents.This guide provides step-by-step instructions to help you:
Install and configure the React Native SDK.
Generate DigiLocker consent URLs from your backend.
Launch DigiLocker in your React Native app.
Handle consent flows and user responses.
Fetch and verify user documents via secure APIs.
All sensitive operations such as generating DigiLocker URLs and retrieving documents, must be performed on your backend server. Don’t call these APIs directly from your frontend or mobile application.
The React Native SDK is hosted on npm. You can get the latest SDK here.Our React Native SDK supports Android SDK version 19 and above and iOS minimum deployment target of 10.3 and above.Navigate to your project and run the following command:
To initiate the DigiLocker integration flow, your application must generate a DigiLocker consent URL.This action must be performed from your backend server, as it requires authentication using your Client Secret. Don’t call this API directly from your frontend or mobile application.Once the DigiLocker URL is successfully generated, the API returns a unique reference_id. Either this reference_id or the verification_id passed by you can be used in all the subsequent API calls.You can view the complete request and response examples in the Create DigiLocker URL API reference.
Once the DigiLocker URL is created, the next step is to open the DigiLocker URL so the user can give the consent. The React Native SDK offer below digilocker redirection flow:
Once the user has successfully logged in and provided consent, call the Get Document API to fetch verified documents like Aadhaar, PAN, or driving license.
Steps 4 and 5 must be performed from your backend server. Don’t call this APIs directly from your frontend or mobile application.