1
Create a Session
Before initializing the SDK, you must create a unique session.
Each SDK instance requires its own session to ensure secure and independent interactions.Use the Create Session endpoint to generate this session.
This is a server-side API call that uses Sandbox Authentication to validate your credentials.Once created, you’ll receive a
Each SDK instance requires its own session to ensure secure and independent interactions.Use the Create Session endpoint to generate this session.
This is a server-side API call that uses Sandbox Authentication to validate your credentials.Once created, you’ll receive a
session_id, which you’ll need when initializing the SDK on the client side.2
Integrate the SDK on the Client Side
After creating the session, the next step is to integrate the DigiLocker SDK into your client-side application.
You’ll add a “Fetch with DigiLocker” button that triggers the DigiLocker flow.
You’ll add a “Fetch with DigiLocker” button that triggers the DigiLocker flow.
3
Handle Session Success and Failure
After a user interacts with the DigiLocker SDK, various events are emitted that indicate the outcome of the session — whether it succeeded, failed, or was canceled.Your event listener (defined earlier) receives these events. You can handle them as follows:To programmatically verify the final status of a session, you can call the Session Status endpoint from your backend.This is useful for confirming completion or troubleshooting unexpected results, especially in cases where the client event might have been interrupted.