https://github.com/openbankproject/obp-typescript
A TypeScript SDK for OBP (Javascript developers might be interested in this)
https://github.com/openbankproject/obp-typescript
Last synced: 11 months ago
JSON representation
A TypeScript SDK for OBP (Javascript developers might be interested in this)
- Host: GitHub
- URL: https://github.com/openbankproject/obp-typescript
- Owner: OpenBankProject
- License: apache-2.0
- Created: 2023-03-08T13:20:17.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2024-10-16T08:16:15.000Z (over 1 year ago)
- Last Synced: 2025-07-02T08:10:37.851Z (12 months ago)
- Language: TypeScript
- Homepage:
- Size: 331 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OBP-TypeScript
#### Install
##### yarn
```
yarn add obp-typescript
```
##### npm
```
npm install obp-typescript
```
#### Example
```typescript
import {
API,
APIClientConfig,
DirectLoginAuthentication,
Version,
get,
create,
Bank,
Account,
Transaction,
GetTransactionsForAccountFull,
TransactionRequestAccountBody,
CreateTransactionRequestAccount,
} from "obp-typescript";
(async () => {
const directLogin: DirectLoginAuthentication = {
username: process.env.OBP_USERNAME || "",
password: process.env.OBP_PASSWORD || "",
consumerKey: process.env.OBP_CONSUMER_KEY || "",
};
const clientConfig: APIClientConfig = {
baseUri: "https://apisandbox.openbankproject.com",
version: Version.v500,
authentication: directLogin,
};
const banks = await get(clientConfig, Bank);
const account = await get(clientConfig, Account);
const transactionFn = get(clientConfig, Transaction);
// Get transaction for account full.
const transactionsForAccountFull = await transactionFn(
GetTransactionsForAccountFull
)("bankId", "accountId", "viewId");
// New transaction body.
const body: TransactionRequestAccountBody = {
description: "Dummy transaction full data",
to: {
bank_id: "bankId",
account_id: "accountId",
},
value: {
currency: "EUR",
amount: 1.0,
},
};
// Create transaction request account.
await create(
clientConfig,
Transaction
)(CreateTransactionRequestAccount)(
"bankId",
"accountId",
"viewId"
)(body);
})();
```