dnb 1.1.2

DNB Open Banking Client

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

Travis Build Status 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(customerId: '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.

Do not commit directly to master. Preferably, make a feature/branchname branch and create a pull request.

License #

MIT © 2019 Arne Molland

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(customerId: 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.1.2

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 Sep 19, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21


Detected platforms: Flutter, other

Primary library: package:dnb/dnb.dart with components: io.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
http ^0.12.0 0.12.0+2
meta ^1.1.7 1.1.7
sigv4 ^1.0.0 1.0.0
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.3
http_parser 3.1.3
path 1.6.4
pedantic 1.8.0+1
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
dotenv ^1.0.0
test ^1.6.4