Typescript SDK
Install Integration Labs Typescript server-side SDK to interact with Integration Labs’ APIs
Installation
Integration Labs’ server-side helper libraries (also known as server-side SDKs) reduce the amount of work required to use Integration Labs’ REST APIs, starting with reducing the boilerplate code you have to write. Below are the installation instructions for these libraries in a variety of popular server-side programming languages.
Open your project folder and run the following bash command on your terminal to install the Integration Labs SDK in your preferred language:
Next, import the RootFi client in your application code:
Instantiate Integration Labs
In your server file, instantiate the Integration Labs instance with your apiKey
. You should generate the API keys on the RootFi Dashboard and add them here.
The resources can be accessed using the instance. All the methods invocations follow the namespaced signature:
Run your first SDK request
Now that you have the Node.js SDK installed, you can access RootFi’s APIs.
1. Core API
2. Unified API
To demonstrate Core APIs, we use the following JavaScript code snippet to make a Create request for creating an invite link. In this example, we create a connect link while specifying the company name
, integration_categories
and integrations
:
To demonstrate Core APIs for fetching a list of all companies, you can use the following JavaScript code snippet:
To demonstrate Unified Accounting APIs, we are using the following JavaScript code snippet to make a List request for accounting data. In this example, we fetch all accounts for a specific connection based on certain filters:
Error Handling
The SDK throws an error when the API request fails. You can catch the error and handle it as shown below: