Parble

Get started with Parble

Transform the way you process documents and extract valuable data with advanced Intelligent Document Processing.

Node.js SDK

This guide will help you get the most out of the Parble Node.js SDK to easily extract data from your documents.

We will explain how to use the SDK in a new or existing inbox. Want to test in your own terminal before integrating? Please check the .

Feel free to check the full documentation on our dedicated .

Installation

It is a prerequisite that you have installed Node.js and npm. If you haven't, please follow the instructions on .

To install the Parble Node.js SDK, run the following command in your terminal:

npm install parble

Usage

To use the Parble Node.js SDK you will need to import the package, initialize the client and call the method to extract the data from your documents.

Importing the Parble module

In most cases, you'll just need to require the Parble module:

const parble = require('parble');

If you're building your own module, or using TypeScript, the equivalent would be:

import * as parble from 'parble';

Initializing the Parble client

To initialize the client, provide the name of your tenant and your API key. You can find your API key and tenant name in your dashboard after login in.

const parble_sdk = new parble.parbleSDK("YOUR_TENANT_ID", "YOUR_API_KEY");

Processing files with Parble

To process your files, call the method “post” inside the “files” class of the Parble client and provide the file you want to process.

You only need to provide the file path, the endpoint is designed to take care of the rest, such as splitting and classifying the file and afterwards extracting the relevant information from it.

The method returns the output with the extracted data from your file. Checking the return can be done in two different as shown in the examples below.

Example of how to chain the calls:

parble_sdk.files.post("PATH_TO_YOUR_FILE", "INBOX_ID").then((file_results) => {
  console.log(file_results);
});

Example of how to use the async/await syntax:

async function processFile(path, inbox_id) {
  const file_results = await parble_sdk.files.post(path, inbox_id));
  console.log(file_results);

processFile("PATH_TO_YOUR_FILE", "INBOX_ID")

Extra features

The Parble Node.js SDK also provides other built-in methods. We invite you to check out the github repository to see the full documentation of the SDK. Some of the examples would be:

  • Obtain the output from a previously processed file id

  • Check your tenant usage stats

  • Manage your API keys

  • Consult the balance of your account