Skip to main content
Install the SDK, initialize the client, and post your first transaction.
1

Install the SDK

Create a Node.js project and install the SDK.
bash
npm init -y
npm install @blnkfinance/blnk-typescript
2

Create a script

Create index.js:
index.js
const { BlnkInit } = require('@blnkfinance/blnk-typescript');

const blnk = BlnkInit('', { baseUrl: 'http://localhost:5001' });

async function main() {
  const response = await blnk.Transactions.create({
    precise_amount: 100000,
    reference: 'first_txn_001',
    currency: 'USD',
    precision: 100,
    source: '@FundingPool',
    destination: '@MyBalance',
    description: 'My first Blnk transaction',
    allow_overdraft: true,
  });

  if (response.status !== 201 || !response.data) {
    throw new Error(response.message);
  }

  console.log(response.data.transaction_id);
}

main();
3

Run it

Run the script with node index.js.
4

View the transaction

Open Blnk Cloud or use the CLI to confirm the transaction was created.