Dojah Financial Widget
The Dojah platform has a smooth widget which enables your users authorize access to their accounts. This widget works effortlessly across various browsers and devices of all sizes.

How to Generate Widget

Using the Dojah CDN-hosted javascript client library, you can install the Dojah widget into your application. You only have to add the script tag to your html document and insert basic configuration parameters and you'll be good to go.

Step 1: Add the Client Javascript Library

Include the script tag just before the end of the closing body tag of your desired html page where you wish to give users the ability to authorize access to a financial institution.
1
<script src="https://widget.dojah.io/widget.js"></script>
Copied!
Adding the async attribute can cause the inline code to return undefined because the library may not be available at that moment. So avoid the use of async and defer for now.

Step 2: Configure the Javascript Client Library

At this point, you can now create a Dojah widget object. passing in your public key and one javascript object representing your preferred configuration options.
1
new DojaWidget(public_key, options);
Copied!
public key (string, required)
This is the Dojah public key, you can find this on the Apps pa
options
This is an optional no-arguments callback function. As soon as the client library is done initializing, the function is called. The callback contain codes you wish to run as soon as the library is executed.
onSuccess (function, required)
This callback takes one argument, this is called when your user has successfully completed enrollment with their preferred institution.
onClose (function, required)
This callback takes no argument, this is called when your user leaves the Dojah widget.

Step 3: Handle a Successful Enrollment

On successful enrollment, the onSuccess callback function that you supplied is called by the client library. We then return the connected account code to your server.
1
{
2
// A unique code for the enrolled account.
3
'code': '[email protected]#[email protected]$%Sda2452SDf',
4
}
Copied!

Dojah Widget Example Script:

doja_widget.html
1
<html lang="en">
2
3
<head>
4
<meta charset="UTF-8">
5
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6
<title>Dojah Widget Sample Script</title>
7
</head>
8
9
<body>
10
<button id="btn-connect">Connect</button>
11
12
<script src="https://widget.dojah.io/widget.js"></script>
13
<script>
14
var options = {
15
app_id: "xxxxxxxxxx",
16
p_key: "test_pk_xxxxxxxxxxxx",
17
onSuccess: function (response) {
18
console.log(response)
19
20
},
21
onError: function (err) {
22
console.log(err)
23
},
24
onClose: function () {
25
console.log("Widget closed")
26
}
27
}
28
29
var connect = new Connect(options)
30
31
connect.setup()
32
33
var connectBtn = document.querySelector('#btn-connect');
34
connectBtn.addEventListener('click', connect.open)
35
</script>
36
</body>
37
38
</html>
Copied!

WIDGET TEST CREDENTIALS

When testing the widget, you can use the following keys to successfully login to the test bank (GTBank)
Last modified 7mo ago