Getting started with the TypeScript SDK
Learn how to work with the Blnk SDK for TypeScript.
Welcome to the Blnk SDK for TypeScript Developer Guide. In this guide, you’ll learn how to install Blnk and work with our Blnk TypeScript SDK. To view the open-source file, see the following: Blnk TypeScript SDK.
You’ll also find examples of running different fintech use cases with our TypeScript SDK.
Prerequisites
Ensure that you have the following installed on your machine.
- Docker and Compose for running Blnk locally on your machine.
- Node.js (v14.0.0 or later) and npm for installing the Blnk Typescript SDK.
1. Installation & Configuration
Once you’re good to go with the prerequisites, you can set up your Blnk server and SDK in 5 steps:
Clone the Blnk repository
Run the following command in your terminal to clone Blnk to your local machine:
Set up your Blnk configuration
Create a blnk.json
file in your blnk
project folder, paste the following configuration settings, and save.
This configuration sets up the required connections to PostgreSQL and Redis, specifies your server details, and allows Slack notifications if needed.
Launch Blnk
Launch the Blnk server with the following command:
Once running, your server will be accessible at http://localhost:5001.
Install Blnk CLI
The Blnk CLI helps you to quickly test and manage your Blnk backend directly from your command line. You can also use it to perform create actions or view your data tables. To install and use the Blnk CLI, see the following in: Installing the Blnk CLI.
To confirm that the CLI has been installed, run the following command:
2. Install the Blnk TypeScript SDK
In your blnk
project folder, install Blnk Typescript SDK.
3. Create your first ledger
A ledger is a folder for grouping balances together in your Blnk server. To learn more, see the following: Introduction to Ledgers
To create a ledger using the TypeScript SDK:
You can confirm that the ledger has been created with the Blnk CLI:
4. Create your first balance
A balance is used to represent a store of value in your Blnk server, e.g., wallet or account. To learn more, see the following: Introduction to Balances
To create a balance using the TypeScript SDK:
You can confirm that the balance has been created with the Blnk CLI:
5. Record your first transaction
Transaction records represent all financial activities (money in and money out) happening within your Blnk ledger. All transactions are immutable (cannot be modified or deleted) and idempotent (producing the same result no matter how many times an operation is performed).
To record a transaction using the TypeScript SDK:
You can confirm that the transaction has been created with the Blnk CLI:
Need help?
We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool.
To ask questions or discuss issues, please join our Discord community.
Manage your Blnk Ledger and explore advanced features (access control & collaboration, anomaly detection, secure storage & file management, etc.) in one dashboard.
Issue reporting
If you encounter any issues while installing or using this SDK, please report them on Github.
Was this page helpful?