import { BanklinkV2 } from '@banklink/sdk/v2';
The default Banklink export from @banklink/sdk is the v1 client. v2 is the separate BanklinkV2 client, so both can run side by side.
This is the Node.js SDK. v2 support in the Python SDK is coming soon.
| Option |
Type |
|
apiKey |
string |
Required. A live key with v2 turned on |
key |
string |
Your customer key seed. Use this or keyProvider |
keyProvider |
() => string | Promise<string> |
Loads the seed when it’s needed |
hostVersionCache |
VersionCache |
Remembers the newest verified worker list. See Customer keys |
timeoutMs |
number |
Default time limit for a job |
requestTimeoutMs |
number |
Time limit for each HTTP request |
pollIntervalMs |
number |
How often to check on a running job |
baseUrl |
string |
Defaults to the Banklink API. Must be https |
fetch |
typeof fetch |
Your own fetch, for proxies or instrumentation |
| Method |
Returns |
|
profiles.syncOnce(input) |
Promise<unknown> |
One-off fetch. Stores nothing and needs no customer key |
profiles.create(input) |
Promise<{ id, bankId, data }> |
Saves a login and returns the first result |
profiles.sync(id, options?) |
Promise<unknown> |
Fetches with a saved login |
profiles.verify(id, options?) |
Promise<unknown> |
Signs in with a saved login to check it still works |
input for syncOnce and create is { bank, fields, nickname? } plus the job options below.
| Option |
Type |
|
fromDate, toDate |
string |
Date range, YYYY-MM-DD |
accounts |
string[] |
Only these account numbers |
onStatus |
(status: JobStatus) => void |
Progress events |
onOtp |
() => Promise<string> |
Returns a one-time PIN when the bank asks for one |
signal |
AbortSignal |
Cancels the job |
timeoutMs |
number |
Time limit for this job |
| Method |
Returns |
|
profiles.list() |
Promise<ProfileMetadata[]> |
{ id, bankId, nickname, kid, credentialVersion, createdAt } |
profiles.delete(id) |
Promise<void> |
Removes the saved login |
| Method |
Returns |
|
keys.init(seed?) |
Promise<string> |
Registers a customer key and returns its seed. Back the seed up |
keys.current() |
Promise<KeyInfo> |
The registered public key. Throws KeyMismatchError if your seed doesn’t match |
keys.pending() |
Promise<KeyInfo | null> |
A rotation that hasn’t finished |
keys.rotate(newSeed, options?) |
Promise |
Re-wraps every saved login to the new key. { rollDataKeys: true } also runs a verify job for each |
| Method |
Returns |
|
banks.list() |
Promise<Bank[]> |
{ bankId, needsOtpEveryLogin, fields: { name, label, secret }[] } |
See Errors and limits. The SDK source, including the customer-side cryptography, is in the SDK repository.