Live demo of agent247 on Digio's docs — click the orange button at the bottom right to start.

SDK Integration

Steps to Integrate the FIU Web SDK

To successfully integrate the Digio FIU Web SDK into your application, please follow these steps:

1. Integrate the SDK

Begin by incorporating the Digio FIU Web SDK into your application. This step involves adding the necessary SDK files and dependencies to your project.

2. Import and Invoke the SDK Function

Import the fiuSdk function from the FIU SDK into your code. When invoking this function, pass the required parameters: the Consent Request Id, Customer Id and Gateway Token Id. This is essential for ensuring proper communication with the SDK.

3. Validation and Redirection

Upon receiving the Gateway Token and Consent Request ID, the SDK will validate these credentials. If the validation is successful, the SDK will redirect the user to the appropriate Account Aggregator as configured in your setup.

By following these steps, you can seamlessly integrate the Digio FIU SDK into your application, enabling efficient interactions with financial information services. Note:- To facilitate web redirection, a secret must be established between the FIU and AA. Digio will assist in issuing the web redirection secret for the respective FIUs.

Sandbox SDK URL to be included in your project:- https://ext.digio.in/sdk/v11/digio.js

const options = {
            environment: 'sandbox',
            is_redirection_approach: true,
	   redirect_url: 'https://google.com'
        };

var digio = new Digio(options)
digio.init()
digio.submit(
 "CRD240716120319646T1GV7FMFT7L5TN", // consent request Id
 "CID2411251657469066HAYCFC146GXP9", // customer Id
 "GWT240716120319677CCJA3H6ON217EU" // gateway token id
)

Typescript integration

Steps to Integrate Digio SDK with Typescript Based Project:- Include the script tag in index.html page in the head tag

<script src="https://ext.digio.in/sdk/v12/digio.js"></script>

create and export the interface

interface DigioOptions {
    environment: 'sandbox' | 'production'; // Assuming environment can be sandbox or 'production'
    callback?: (response: any) => void; // Optional callback function
    logo?: string; // Optional logo URL
    redirect_url?: string | null; // Optional redirect URL which can be null
    is_iframe?: boolean; // Optional flag for iframe
    is_redirection_approach?: boolean; // Optional flag for redirection approach
}

If type definition file does not exists, create a new type definition file at the root of the project and enter the below code


declare class Digio {
    constructor(options: DigioOptions);
    init(): void;
    submit(entityId: string, customerId: string, token: string): void;
}

declare const digio: Digio;

Post this Digio object should be valid inside a typescript project, then the below sample code should work without any issues.

const options = {
    environment: 'sandbox', //Give sandbox or production based on the usecase
    is_redirection_approach: true,
};


var digio = new Digio(options)
digio.init()
digio.submit(
 "CRD240716120319646T1GV7FMFT7L5TN", // pass generated consent request Id
 "CID2411251657469066HAYCFC146GXP9", // pass generated customer Id
 "GWT240716120319677CCJA3H6ON217EU"  // pass generated gateway token id
)

Common Headers

These headers are common for all the APIs


authorization: “Basic Base64encodedValueOf(client_id:client_secret)”
content-type : “application/json”

Was this page helpful?