npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sxored-js

v0.1.1

Published

Satellite is Sxored's official SDK that enables any client to integrate production ready loan origination model into any applications in a matter of minutes.

Downloads

12

Readme

 ######   ##    ##   #######   ########   ########  ########
##    ##   #    #   ##     ##  ##     ##  ##        ##     ##
##          #  #    ##     ##  ##     ##  ##        ##     ##
 ######      ##     ##     ##  ########   ######    ##     ##
      ##    #  #    ##     ##  ##   ##    ##        ##     ##
##    ##   #    #   ##     ##  ##    ##   ##        ##     ##
 ######   ##    ##   #######   ##     ##  ########  ########

==============================================================
 Sxored's Satellite - JavaScript Version
==============================================================

Framework for building Loan Origination Assistants

npm shield

Sxored.js (Satellite)

Satellite is a JavaScript/TypeScript SDK for easy integration with the Sxored AI. It provides simple methods to extract information from ID cards (KTP), bank statements and such.

1. Installation

You can install the Sxored's Satellite using npm:

npm install sxored-js

or yarn:

yarn add sxored-js

2. Usage

Initialization

First, import and initialize the SDK with your API key:

import Satellite from 'sxored-js';

const client = new Satellite({
  // Must be registered as PT. Sxored Veritas Finansial's client.
  apiKey: 'your-api-key-here' 
});

2. 1. Module: Personal Information

Extracting Information from an ID Card

const file = // ... your File object (e.g., from a file input)

try {
  const result = await client.extractIdCard(file);
  console.log('ID Card data:', result.data);
} catch (error) {
  console.error('ID Card extraction failed:', error);
}

Extracting Information from Payslip

const file = // ... your File object (e.g., from a file input)

try {
  const result = await client.extractPaySlip(file);
  console.log('Payslip data:', result.data);
} catch (error) {
  console.error('Payslip extraction failed:', error);
}

Extracting Information from Deed of Establishment

const file = // ... your File object (e.g., from a file input)

try {
  const result = await client.extractDeed(file);
  console.log('Deed data:', result.data);
} catch (error) {
  console.error('Deed extraction failed:', error);
}

2. 2. Module: Financial Information

Extracting Information from a Bank Statement

const file = // ... your File object (e.g., from a file input)

try {
  const result = await client.extractBankStatement(file, password);
  console.log('Bank Statement data:', result.data);
} catch (error) {
  console.error('Bank Statement extraction failed:', error);
}

Extracting Information from OJK SLIK

const file = // ... your File object (e.g., from a file input)

try {
  const result = await client.extractSLIK(file);
  console.log('OJK SLIK data:', result.data);
} catch (error) {
  console.error('OJK SLIK extraction failed:', error);
}

2. 3. Module: Collateral Information

Extracting Information from a Property Tax

const file = // ... your File object (e.g., from a file input)

try {
  const result = await client.extractPBB(file);
  console.log('Property tax data:', result.data);
} catch (error) {
  console.error('Property tax extraction failed:', error);
}

Searching Nearest Point of Interest from Tax Object

const data = {
  address: "address of tax object",
  radius: "in kilometer"
}

try {
  const result = await client.findNearestPlace(data);
  console.log('Places found:', result.data);
} catch (error) {
  console.error('Places searching failed:', error);
}

Searching Nearest Mass Org Office/Base from Tax Object

const data = {
  keyword: "kantor ormas",
  address: "address of tax object",
  radius: "in kilometer"
}

try {
  const result = await client.findOrmas(data);
  console.log('Places found:', result.data);
} catch (error) {
  console.error('Places searching failed:', error);
}

Searching Property Prices Around Tax Object

const data = {
  address: "address of tax object"
}

try {
  const result = await client.housePrice(data);
  console.log('Prices found:', result.data);
} catch (error) {
  console.error('Prices searching failed:', error);
}

2. 4. Module: Utility

Check for Holiday

const data = {
  date: "2024-10-10",
  timezone: "Asia/Jakarta"
}

try {
  const result = await client.checkHoliday(data);
  console.log('Data:', result.data);
} catch (error) {
  console.error('Data fetch failed:', error);
}

3. API Reference

new Satellite(config)

Creates a new instance of the SDK.

  • config.apiKey (string, required): Your Sxored Satellite API key

client.extractIdCard(file)

client.extractPBB(file)

Extracts information from an image.

  • file (File | Buffer): The image file

Returns a Promise that resolves with the extracted data.

client.extractPaySlip(file)

client.extractDeed(file)

client.extractSLIK(file)

Extracts information from PDF file (no password).

  • file (File | Buffer): The PDF file

Returns a Promise that resolves with the extracted data.

client.extractBankStatement(file, password)

Extracts information from PDF file (encrypted).

  • file (File | Buffer): The bank statement file (typically a PDF)
  • password (String): The bank statement PDF password (typically user birthdate)

Returns a Promise that resolves with the extracted bank statement data.

client.findNearestPlace(data)

Get point of interest information from a JSON object

data = {
  address: str, 
  radius: int
}
  • data (Record<string, any>): The JSON data to extract information from

Returns a Promise that resolves with the places data.

client.findOrmas(data)

Get specific place information from a JSON object

data = {
  keyword: str,
  address: str, 
  radius: int
}
  • data (Record<string, any>): The JSON data to extract information from

Returns a Promise that resolves with the places data.

client.housePrice(data)

Get prices information from a JSON object

data = {
  address: str
}
  • data (Record<string, any>): The JSON data to extract information from

Returns a Promise that resolves with the prices data.

4. Example (React)

Here's a simple example of how to use the SDK in a React component:

import React, { useState } from 'react';
import Satellite from 'sxored-js';

const sdk = new Satellite({ apiKey: 'your-api-key-here' });

const DocumentExtractor = () => {
  const [result, setResult] = useState(null);
  const [error, setError] = useState(null);

  const handleFileUpload = async (event, type) => {
    const file = event.target.files[0];
    if (!file) return;

    try {
      let extractionResult;
      if (type === 'idcard') {
        extractionResult = await sdk.extractIdCard(file);
      } else {
        extractionResult = await sdk.extractBankStatement(file, password);
      }
      setResult(extractionResult);
      setError(null);
    } catch (err) {
      setError(err.message);
      setResult(null);
    }
  };

  return (
    <div>
      <h1>Document Extractor</h1>
      <div>
        <h2>ID Card</h2>
        <input type="file" onChange={(e) => handleFileUpload(e, 'idcard')} />
      </div>
      <div>
        <h2>Bank Statement</h2>
        <input type="file" onChange={(e) => handleFileUpload(e, 'bankStatement')} />
      </div>
      {result && (
        <div>
          <h3>Result:</h3>
          <pre>{JSON.stringify(result, null, 2)}</pre>
        </div>
      )}
      {error && <div style={{ color: 'red' }}>Error: {error}</div>}
    </div>
  );
};

export default DocumentExtractor;

5. TypeScript Support

This SDK includes TypeScript declarations. You can use it in your TypeScript projects without any additional setup.

6. License

This project is licensed under the MIT License - see the LICENSE file for details.