Skip to content

leaseqinc/leaseq-node

Repository files navigation

LeaseQ Node SDK

WARNING: this package is not stable yet. Expect breaking changes.

Submit credit applications to LeaseQ. This library supports both the browser and nodeJS.

Installation

Using yarn:

yarn add leaseq-node

Using npm:

npm install leaseq-node

Usage

Async/Await:

import LeaseQ from 'leaseq-node';

const api = new LeaseQ();

await api.login({
    email: '<your email>',
    password: '<your password>'
});

const { app_id } = await api.submitApplication({
    /* application data */
});

await api.uploadDocument(app_id, {
    /* file data */
});

Promises:

import LeaseQ from 'leaseq-node';

const api = new Leaseq();

api.login({
    email: '<your email>',
    password: '<your password>'
})
    .then(() => LeaseQ.submitApplication({
        /* application data */
    }))
    .then(({ app_id }) => LeaseQ.uploadDocument(app_id, {
        /* file data */
    }));

Contribution

To install:

yarn install

To test:

yarn test

To build:

yarn build