GithubHelp home page GithubHelp logo

nordigen.net's Introduction

build and test NuGet GitHub license

N|Solid

Nordigen.Net

Unofficial .NET SDK for Nordigen. The only missing part are premiums. Because of the unclear documentation on the responses for them the Api, this library will remain on hold until further notice.

How to use it

1- Install the nuget package

Install-Package Nordigen.Net

2- Add a configuration section into your app, and configure it (the values shown below are the default ones except the keys)

"NordigenApi" : {
    "Url" : "https://ob.nordigen.com/",
    "SecretId" : "SOME_SECRET_ID_HERE",
    "SecretKey" : "SOME_SECRET_KEY_HERE",
    "AccessTokenValidBeforeSeconds" : 5,
    "RefreshTokenValidBeforeSeconds" : 5
}

Although this is not required is recommended if you want to use an internal api to test.

3- Add the SDK to your services collection

services.AddNordigenApi();

4- Now you can access a set of interfaces to reach the Nordigen platform

INordigenApi => Just inject this and you can have access to all the endpoints with the members
IAccountsEndpoint => Access to Accounts
IInstitutionsEndpoint => Access to Institutions
IRequisitionsEndpoint => Access to Requisitions
IAgreementsEndpoint => Access to Agreements

Retries

You can easily plug retries with Polly when registering the api. Install the nuget package

Install-Package Microsoft.Extensions.Http.Polly

Configure your retries:

services
  .AddNordigenApi()
  .AddPolicyHandler(
      HttpPolicyExtensions
        .HandleTransientHttpError()
        .OrResult(msg => msg.StatusCode == System.Net.HttpStatusCode.ServiceUnavailable)
        .WaitAndRetryAsync(6, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2,retryAttempt))));

Result handling

The library uses discriminated unions to return values, when the second option will allways be an Error if present.

For example when querying accounts:

var result = await _accountsEndpoint.Get(id, cancellationToken);

_ = result.Match(
	   account => async _ => { await _accountsDatabase.SaveAsync(account, cancellationToken); },
	   error => { _logger.Error(error.Detail); }
	);

Token management

The SDK handles the lifetime/renewal of tokens automatically for you, so only requirement is to configure your SecretId and SecretKey

Credits

OneOf simplified credit goes to Harry McIntyre

Logo Provided by Vecteezy

Contributors

@felox2

nordigen.net's People

Contributors

dariogriffo avatar borisgerretzen avatar lesbass 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.