Coder Social home page Coder Social logo

nordigen-bank-ui's Introduction

Nordigen Bank UI

Nordigen Bank UI

Installation

To install library, you can use npm or yarn

$ npm install --save nordigen-bank-ui
$ yarn add nordigen-bank-ui

Or add package via script tag using CDN

Examples

Full example can be found in a demo folder.

Create index.html

<link href="./node_modules/nordigen-bank-ui/package/src/selector.min.css" rel="stylesheet" />

    <div id="institution-content-wrapper"></div>

<script src="./node_modules/nordigen-bank-ui/package/src/selector.min.js"></script>

Next step is to fetch institutions list from Nordigen API

// Assume this is response from the API
const exampleList = [
    {
        "id": "ABNAMRO_ABNAGB2LXXX",
        "name": "ABN AMRO Bank Commercial",
        "bic": "ABNAGB2LXXX",
        "transaction_total_days": "540",
        "countries": [
            "GB"
        ],
        "logo": "https://cdn.nordigen.com/ais/ABNAMRO_FTSBDEFAXXX.png"
    },
    {
        "id": "BBVAUK_BBVAGB2L",
        "name": "BBVA",
        "bic": "BBVAGB2L",
        "transaction_total_days": "730",
        "countries": [
            "GB"
        ],
        "logo": "https://cdn.nordigen.com/ais/BBVABE_BBVABEBB.png"
    },
];

Create institutionSelector instance and pass following parameters:

  • exampleList - list of aspsp fetched from Nordigen API
  • institution-modal-content - div where all banks will be appended
  • configs object
// Pass your redirect link after user has been authorized in institution
const config = {
    // Redirect URL that is being used when modal is being closed.
    redirectUrl: 'https://www.example.com',
    // Text that will be displayed on the left side under the logo. Text is limited to 100 characters, and rest will be truncated.
    text: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean mavdvd",
    // Logo URL that will be shown below the modal form.
    logoUrl: 'https://cdn.nordigen.com/ais/Nordigen_Logo_Black.svg',
    // Will display country list with corresponding institutions. When `countryFilter` is set to `false`, only list of institutions will be shown.
    countryFilter: false,
    // style configs
    styles: {
        // Primary
        // Link to google font
        fontFamily: 'https://fonts.googleapis.com/css2?family=Roboto&display=swap',
        fontSize: '15',
        backgroundColor: '#F2F2F2',
        textColor: '#222',
        headingColor: '#222',
        linkColor: '#8d9090',
        // Modal
        modalTextColor: '#1B2021',
        modalBackgroundColor: '#fff',
        // Button
        buttonColor: '#3A53EE',
        buttonTextColor: '#fff'
    }
};


new institutionSelector(exampleList, 'institution-modal-content', config);

To use internalization pass query parameter lang with appropriate language in ISO 639-1 format lang=de

If custom redirect flow is required with institution_id in URL

const institutionList = Array.from(document.querySelectorAll('.ob-list-institution > a'));

institutionList.forEach((institution) => {
    institution.addEventListener('click', (e) => {
        e.preventDefault()
        const institutionId = institution.getAttribute('data-institution');
        window.location.href = `https://example.com/${institutionId}`
    });
});

Development

Minify and add vendor prefixes before pushing CSS and JS changes

npm run build

To test fully working example application, consider checking the following repositories and their corresponding examples:

nordigen-bank-ui's People

Contributors

victory-sokolov avatar dependabot[bot] avatar mr-andersons avatar hjheath avatar ebspeter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.