Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Nordigen

Unofficial Nordigen API for JavaScript

author

Julian Riemersma (https://github.com/AppelBoomHD)

license

MIT License

Hierarchy

  • Nordigen

Index

Constructors

constructor

  • new Nordigen(secretId: string, secretKey: string, endpoint?: string): Nordigen
  • Create a new instance of the Nordigen API

    Example (es module)

    import Nordigen from 'nordigen-cf-workers'
    const nordigen = new Nordigen(secretId, secretKey);
    

    Parameters

    • secretId: string
    • secretKey: string
    • Default value endpoint: string = "https://ob.nordigen.com/api/v2"

      Endpoint URL for the Nordigen API

    Returns Nordigen

Properties

Readonly endpoint

endpoint: string

Endpoint URL to use

Private Readonly headers

headers: {}

Headers

Type declaration

  • [key: string]: string

Private Readonly secretId

secretId: string

Secret ID for the Nordigen API

Private Readonly secretKey

secretKey: string

Secret Key for the Nordigen API

Methods

createEndUserAgreement

  • createEndUserAgreement(__namedParameters: { accessScope: undefined | string[]; accessValidForDays: undefined | number; institutionId: string; maxHistoricalDays: undefined | number }): Promise<EndUserAgreement>
  • Create a new end user agreement for a user. Use this step only if you want to specify the length of transaction history you want to retrieve, the length of time the end-user's access token is valid for and the scope of the access token. If you skip this step, by default 90 days of transaction history will be retrieved, the end-user's access token will be valid for 90 days and the user will get access to all scopes.

    Parameters

    • __namedParameters: { accessScope: undefined | string[]; accessValidForDays: undefined | number; institutionId: string; maxHistoricalDays: undefined | number }
      • accessScope: undefined | string[]

        The scope of the access token

      • accessValidForDays: undefined | number

        The length of time the end-user's access token is valid for

      • institutionId: string

        Id of the institution for which you want to create a requisition

      • maxHistoricalDays: undefined | number

        The length of the transaction history to be retrieved

    Returns Promise<EndUserAgreement>

    End user agreement

createRequisition

  • createRequisition(__namedParameters: { accountSelection: undefined | false | true; agreement: undefined | EndUserAgreement; institutionId: string; redirect: string; reference: undefined | string; userLanguage: undefined | string }): Promise<Requisition>
  • Create a requisition for a user

    Parameters

    • __namedParameters: { accountSelection: undefined | false | true; agreement: undefined | EndUserAgreement; institutionId: string; redirect: string; reference: undefined | string; userLanguage: undefined | string }
      • accountSelection: undefined | false | true

        Enable account selection

      • agreement: undefined | EndUserAgreement
      • institutionId: string

        Id of the institution for which you want to create a requisition

      • redirect: string

        URI where the end user will be redirected after finishing authentication with Institution

      • reference: undefined | string

        Additional layer of unique ID defined by you

      • userLanguage: undefined | string

        To enforce a language for all end user steps hosted by Nordigen passed as a two-letter country code (ISO 3166). If user_language is not defined a language set in browser will be used to determine language

    Returns Promise<Requisition>

    Requisition answer

generateToken

  • generateToken(): Promise<void>

getAccountBalances

  • getAccountBalances(accountId: string): Promise<BalanceData>
  • Get a list of all balances an account ID holds

    Parameters

    • accountId: string

      Account ID to check

    Returns Promise<BalanceData>

    Balances for the account

getAccountDetails

getAccountTransactions

  • Get a list of all transactions an account ID holds

    Parameters

    • accountId: string

      Account ID to check

    Returns Promise<TransactionData>

    Transactions for the account

getInstitutions

  • getInstitutions(countryCode: string): Promise<ReadonlyArray<Institution>>
  • Get a list of Institutions (Banks) for a given country

    Parameters

    • countryCode: string

      Country code to use, e.g. "GB" for Great Britain

    Returns Promise<ReadonlyArray<Institution>>

    Array of Institutions

getRequisitionInfo

  • getRequisitionInfo(requisitionId: string): Promise<Requisition>
  • Get information about a user requisition. This can be used to get a list of all user accounts by getting requisition.accounts

    Parameters

    • requisitionId: string

      Requisition ID of an existing requistion

    Returns Promise<Requisition>

    Requisition info

makeRequest

  • makeRequest(path: string, method?: string, body?: Record<string, unknown> | false): Promise<unknown>
  • Make an authenticated request to the Nordigen API

    Parameters

    • path: string

      Relative path to the requested endpoint

    • Default value method: string = "GET"

      Method to use

    • Default value body: Record<string, unknown> | false = false

      Message Body

    Returns Promise<unknown>

    JSON Response

Generated using TypeDoc