New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sproutasia/sprout-basisid-api

Package Overview
Dependencies
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sproutasia/sprout-basisid-api

Sprout's interface with BASISID

  • 1.0.4
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
5
Weekly downloads
 
Created
Source

sprout-basisid-api

Simplified BasisID Rest API http request for Sprout Apps

Key features

  • Send Basic Data
  • Upload Document
  • Upload Video
  • Upload Image
  • Upload Bank Statement
  • Upload Utility Bill
  • Upload Proof of Income
  • Get User Profile Information

Installation

1.Install package

To install sprout-basis-api with npm:

npm install @sproutasia/sprout-basisid-api --save

To install sprout-basis-api with yarn:

yarn add @sproutasia/sprout-basisid-api --save

Usage

Here is a basic example of using sprout-basisid-api within a nodejs application.

const BasisController = require("@sproutasia/sprout-basisid-api");
const basis = new BasisController(
  "<TypeGoesHere>",
  false,
  "<ApiKeyGoesHere>",
  "<SecretGoesHere>"
);

// Send basic data
basis.sendBasicData(payload);

// payload must be Buffer object, here is the example of how to generate it
const file = fs.createReadStream("./toBeUploadedFile");
const getBuffer = new Promise((resolve, error) => {
  const buffer = [];
  let buf = null;
  file.on("data", (chunk) => {
    buffer.push(chunk);
  });

  file.on("end", () => {
    buf = Buffer.concat(buffer);
    file.destroy();
    resolve(buf);
  });

  file.on("error", () => {
    file.destroy();
    error(
      new Error({
        message: "Error readStream",
      })
    );
  });
});

// Upload document (using buffer object that mentioned earlier)
basis.uploadDocument(
  await getBuffer,
  "<UserHashGoesHere>",
  "<CheckIdGoesHere>",
  "<StepGoesHere>"
);
// Upload video (using buffer object that mentioned earlier)
basis.uploadVideo(await getBuffer, "<UserHashGoesHere>", "<CheckIdGoesHere>");

// Upload image (using buffer object that mentioned earlier)
basis.uploadImage(await getBuffer, "<UserHashGoesHere>", "<CheckIdGoesHere>");

// Upload bank statement (using buffer object that mentioned earlier)
basis.uploadBankStatement(
  await getBuffer,
  "<UserHashGoesHere>",
  "<CheckIdGoesHere>"
);

// Upload utility bill (using buffer object that mentioned earlier)
basis.uploadUtilityBill(
  await getBuffer,
  "<UserHashGoesHere>",
  "<CheckIdGoesHere>"
);

// Upload proof of income (using buffer object that mentioned earlier)
basis.uploadProofOfIncome(
  await getBuffer,
  "<UserHashGoesHere>",
  "<CheckIdGoesHere>"
);

// Get users info
basis.getUserProfileInformation("<UserHashGoesHere>");

FAQs

Package last updated on 28 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc