The Open Banking reference app is a sample app to Mastercard's Open Banking APIs where users can explore examples of how Connect and other APIs can be implemented into their applications. The reference app will allow you to create test customers and also seek permission to access test account data from one or more of their test accounts. Please note that applications accessing the Open Banking APIs must be hosted within the United States.
- Node (v14+)
- ReactJS (v18.2.21)
This application is built using the ReactJS framework. ReactJS requires Node version 14+. However, It is recommended that you use one of NodeJS's LTS releases or one of the more general recent releases. A Node version manager such as nvm (Mac and Linux) or nvm-windows can help with this.
Before using the open banking reference application, you will need to set up a project in the local machine. The following commands will help you to get the latest code and install the required dependencies on your machine.
git clone https://github.com/Mastercard/open-banking-reference-application.git
cd open-banking-reference-application && npm i
Follow the steps mentioned in the document to generate your credentials.
- Login to Mastercard developer's portal
- Log in and click the Create Project button at the top of this page
- Select Open Banking and follow the step-by-step instructions
- Take note of your Partner ID, Partner Secret and App Key. These will be required in the following sections.
Open banking reference application needs Sandbox API credentials added in the .env file to make the API calls.
- Create the
.env
file.cp .env.template .env
- Update the
.env
file with your Sandbox API credentials generated in step 1.
Run the following command to start the application.
npm start
Now that you have a Customer ID, the next step is to add a bank account.
The following command will execute the test cases and show the result.
npm run test
This step is required only when the application needs to be deployed on the server.
Run the following command to create the application build.
npm run build
Refer to the below code snippet for creating an express application. In addition to that we are using http-proxy-middleware for handling proxy requests to open banking APIs or you can set up your proxy server for managing CORS (cross-origin-resource-sharing).
const express = require('express');
const {createProxyMiddleware} = require('http-proxy-middleware');
const app = express();
const port = process.env.PORT || 4000;
app.use(express.static('build'));
app.use(
['/aggregation/**', '/connect/**'],
createProxyMiddleware({
target: 'https://api.finicity.com',
changeOrigin: true,
})
);
app.listen(port, () => {
console.log(`Example app listening on port ${port}`);
});
If you have any issues or concerns, please click here to submit an issue and our team will get back to you as soon as possible.