dnb 1.2.1

DNB Open Banking Client

A Dart client for DNB's API products. (Under development, may change)

GitHub Actions Badge npm (latest) GitHub contributors License Gitmoji

The APIs are currently under development and may change. To use this API, you have to create an application at https://developer.dnb.no.

See examples below.

Usage #

import 'package:dnb/dnb.dart' as dnb;

void main() async {
  final client = dnb.OpenBankingClient(
      clientKey: 'YOUR-CLIENT-KEY',
      clientSecret: 'YOUR-CLIENT-SECRET',
      apiKey: 'YOUR-API-KEY',

  /// Retrieve all test customers from sandbox
  final testCustomers = await client.getTestCustomers();

  /// Retrieve token for access to other APIs
  final token = await client.getToken('CUSTOMER-ID');

  /// Retrieve the current customer
  final customer = await client.getCurrentCustomer();

Development #

First, clone the repo. You will need API keys to run the tests. Make a new app at https://developer.dnb.no.

Do pub get.

Run tests with pub run test.

PRs are appreciated.

License #

MIT © 2019 Arne Molland

Changelog #

1.2.1 #

  • Bumped sigv4 version
  • Fixed build status badge
  • Removed deprecated author: field from pubspec

1.2.0+1 #

  • Formatting, updated readme

1.2.0 #


  • Changed all ID parameteres to non-optional

1.1.2 #

Updated README to reflect the recent changes in the library.

1.1.1 #

Actually forgot to bump package version. Because of serious OCD, the pub version and pubspec version has to be in sync.

1.1.0 #

DNB recently updated their APIs, resulting in various changes

Breaking changes: #

  • Removed all Open Banking APIs no longer supported by DNB
  • Removed optional JWT token for all methods, as it's only a duplicate of the jwt field anyway.
  • Separated their Open Banking APIs into its own client to separate from their PSD2 APIs, which is coming to this library in the next minor version
  • Changed parameters for Currency APIs

Other changes:

  • Only signing the getTokenmethod as it's the only API call that needs AWS Signature
  • Added versioning for each API (defaults to current newest version, will try to update ASAP for each release)
  • Updated dependencies
  • Code cleanup and formatting

1.0.1 #

  • Added example

1.0.0 #

  • Initial release


import 'package:dnb/dnb.dart' as dnb;

void main() async {
  final openBankingClient = dnb.OpenBankingClient(
    clientId: 'YOUR-CLIENT-KEY',
    clientSecret: 'YOUR-CLIENT-SECRET',
    apiKey: 'YOUR-API-KEY',

  /// Retrieve all test customers from sandbox
  final testCustomers = await openBankingClient.getTestCustomers();

  /// Retrieve token for access to other APIs
  final token = await openBankingClient.getToken(testCustomers.first);

  /// Retrieve the current customer using the token
  final customer = await openBankingClient.getCurrentCustomer();

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  dnb: ^1.2.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:dnb/dnb.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 12, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Format lib/src/open_banking.dart.

Run dartfmt to format lib/src/open_banking.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
http ^0.12.0+2 0.12.0+4
meta ^1.1.8 1.1.8
sigv4 ^3.1.0 3.1.2
Transitive dependencies
async 2.4.0
charcode 1.1.3
chopper 3.0.1+1
collection 1.14.12
convert 2.1.1
crypto 2.1.4
dio 3.0.8
http_parser 3.1.3
logging 0.11.4
path 1.6.4
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
pedantic ^1.9.0 1.9.0
test ^1.9.4