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 🙏

© 2025 – Pkg Stats / Ryan Hefner

synapsefi-dev-js-api-wrapper

v1.0.11

Published

## Installation ```sh npm installation synapsefi-ui axios lodash ```

Readme

synapsefi-js-api-wrapper

Installation

npm installation synapsefi-ui axios lodash

Motivation

synapsefi-js-api-wrapper was built to simplify api requests to synapsefi's core public apis.

Table of Contents



Setup

ApiWrapper generates instance of apiWrapper. We decide to name an instance as apiWrapper because all it does is firing api calls. User of this library can declare variable with diffrent naming convention.

import ApiWrapper from 'synapsefi-js-api-wrapper'; // for client
// const ApiWrapper = require('synapsefi-js-api-wrapper'); // for node

const platformUserApiWrapper = new ApiWrapper({
  host: 'sandbox or production host(ex: https://uat-api.synapsefi.com)',
  client_id: '<clinet id>',
  client_secret: '<clinet secret>',
  fingerprint: '<fingerprint>',
  ip_address: '<user_id> of platform',
  oauth_key: '<oauth_key>',
  user_id: '<user_id> of platform',
  refresh_token: '<refresh_token> of platform',
});

const endUserApiWrapper = new ApiWrapper({
  host: platformUserApiWrapper.host,
  client_id: platformUserApiWrapper.client_id,
  client_secret: platformUserApiWrapper.client_secret,
  ip_address: platformUserApiWrapper.ip_address,
  user_id: '<user_id> of the end user',
  fingerprint: '<finger print when this user is created>',
  refresh_token: '<refresh_token> of the end user',
  oauth_key: '<oauth_key> of the end user',
});

Users Api Request Examples

Get all client users

(GET_ALL_CLIENT_USERS)

with no argument

platformUserApiWrapper.GET_ALL_CLIENT_USERS().then(({data}) => {
  console.log('data: ', data);
});

search by name or email using query

platformUserApiWrapper.GET_ALL_CLIENT_USERS({ query: 'John Doe' }).then(({data}) => {
  console.log('data: ', data);
});

specific page and per page (page, per_page)

platformUserApiWrapper
  .GET_ALL_CLIENT_USERS({
    page: 2,
    per_page: 3,
  })
  .then(({ data }) => {
    console.log('data: ', data);
  });

conbining query, page, and per_page

platformUserApiWrapper
  .GET_ALL_CLIENT_USERS({
    query: '[email protected]',
    page: 1,
    per_page: 2,
  })
  .then(({ data }) => {
    console.log('data: ', data);
  });

Create User

(POST_CREATE_USER)
platformUserApiWrapper
  .POST_CREATE_USER({
    logins: [{ email: '[email protected]' }],
    phone_numbers: ['123.123.1233'],
    legal_names: ['John Doe'],
  })
  .then(({ data }) => {
    console.log('data: ', data);
  });

Get User

(GET_USER)
platformUserApiWrapper.GET_USER().then(({ data }) => {
  console.log('data: ', data);
});

Add Document

(PATCH_ADD_NEW_DOCUMENTS)
const personalDocuments = [{
  email: '[email protected]',
  phone_number: '1231231233',
  ip: '127.0.0.1',
  name: 'Personal Name',
  alias: 'Test',
  entity_type: 'M',
  entity_scope: 'Arts & Entertainment',
  day: 2,
  month: 5,
  year: 1989,
  address_street: '101 2nd St',
  address_city: 'SF',
  address_subdivision: 'CA',
  address_postal_code: '94105',
  address_country_code: 'US',
  social_docs: [
    {
      document_value: 'https://www.facebook.com/validasdf',
      document_type: 'FACEBOOK',
    },
  ],
}];

platformUserApiWrapper
  .PATCH_ADD_NEW_DOCUMENTS({
    documents: personalDocuments,
  })
  .then(({ data }) => {
    console.log('data: ', data);
  });

Update Exsiting Document

(PATCH_UPDATE_DOCUMENTS)

update base doc

platformUserApiWrapper
  .PATCH_UPDATE_DOCUMENTS([{
    documents: {
      id: '<initialBaseDocId>',
      email: '[email protected]',
    },
  }])
  .then(({ data }) => {
    console.log('data: ', data);
  });

update sub docs

platformUserApiWrapper
  .PATCH_UPDATE_DOCUMENTS({
    documents: [{
      id: '<initialBaseDocId>',
      social_docs: [
        {
          id: '<facebookDocId>',
          document_value: 'https://www.facebook.com/afterUpdate',
          document_type: 'FACEBOOK',
        },
      ],
    },
  }])
  .then(({ data }) => {
    console.log('data: ', data);
  });

Delete Base Doc

(PATCH_DELETE_BASE_DOC)
platformUserApiWrapper
  .PATCH_DELETE_BASE_DOC({ baseDocId: '<document id of base doc>' })
  .then(({ data }) => {
    console.log('data: ', data);
  });

Delete Sub Docs

(PATCH_DELETE_SUB_DOCS)
platformUserApiWrapper
  .PATCH_DELETE_SUB_DOCS({
    baseDocId: '<base_doc_id>',
    socialDocIds: [
      '<social_doc_id 1>',
      '<social_doc_id 2>',
      'fda60784d6375bc44eda...',
      '28d9177b22c127d9a51d...',
    ],
  })
  .then(({ data }) => {
    console.log('data: ', data);
  });

Update User

(PATCH_UPDATE_USER)

update legal name, login email, password, and phone number

platformUserApiWrapper
  .PATCH_UPDATE_USER({
    updateObj: {
      legal_name: 'After User',
      login: { email: '[email protected]' },
      phone_number: '9879879877',
      remove_legal_name: 'Before User',
      remove_login: { email: '[email protected]' },
      remove_phone_number: '1231231233',
    },
  })
  .then(({ data }) => {
    console.log('data: ', data);
  });

update cip_tag

platformUserApiWrapper
  .PATCH_UPDATE_USER({
    updateObj: {
      legal_name: 'After User',
      cip_tag: 2,
      // public_note: 'Eask just updated public note ~~~',
    },
  })
  .then(({ data }) => {
    console.log('data: ', data);
  });

If you include public note then cip tag will not be updated (bug ?)


Update User Permission

(PATCH_USER_PERMISSION)

lock user

endUserApiWrapper
 .PATCH_USER_PERMISSION({
   permission: 'LOCKED',
 })
 .then(({ data }) => {
   console.log('data: ', data);
 });

delete user

 endUserApiWrapper
  .PATCH_USER_PERMISSION({
    permission: 'MAKE-IT-GO-AWAY',
  })
  .then(({ data }) => {
    console.log('data: ', data);
  });


Oauth Key

platformUserApiWrapper.oauth_key = 'fake oauth key';
console.log('platformUserApiWrapper.oauth_key: ', platformUserApiWrapper.oauth_key); // fake oauth key

platformUserApiWrapper.POST_OAUTH_USER().then(({ data }) => {
 console.log('data: ', data);
});

// Calling "POST_OAUTH_USER" set new oauth_key to platformUserApiWrapper.
// platformUserApiWrapper.oauth_key === data.oauth_key
console.log('platformUserApiWrapper.oauth_key: ', platformUserApiWrapper.oauth_key); // data.oauth_key