Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@specialman/safehaven

SGSTeamDev112MIT1.0.2

Node JS SDK for Safe Haven MFB APIs

safehaven, mfb, accounts, transfers, verifications, beneficiaries

readme

Safe Haven NodeJS SDK

Introduction

This SDK simplifies the integration of Safe Haven’s APIs into your application, offering a seamless way to handle authentication, account management, verification, transfers, beneficiaries, and more. This guide provides a detailed overview of the available methods and best practices for effective implementation.

Table of Content

  1. Requirements
  2. Installation
  3. Setup
  4. Usage
  5. Contributing
  6. License

Requirements

Installation

npm install @specialman/safehaven

Setup

When initialized, the SDK authenticates using OAuth2 client credentials to obtain an access token, refresh token, and an IBS Client ID. These credentials are automatically included in the request headers for secure communication with Safe Haven’s API. The SDK automatically refresh token (every 30 mins) before expiry.

const safeHavenSDK = require("@specialman/safehaven");

const safe_haven = safeHavenSDK({
  client_id: process.env.CLIENT_ID,
  client_assertion: process.env.CLIENT_ASSERTION,
  env: "sandbox", // or "production"
})
  .then((sdk) => sdk)
  .catch((error) => {
    console.error("SDK Initialization Failed:", error);
  });

Usage

  1. Responses
  2. Accounts
  3. Verification
  4. Transfers
  5. Beneficiaries

Refer to the Safe Haven API Reference for detailed information on the parameters and options available for each method or request.

Contributing

We welcome community contributions to this project.

Please read our Contributor Guide for more information on how to get started. Please also read our Contributor Terms before you make any contributions.

License

By contributing to this project, you agree that your contributions will be licensed under its MIT license.

Copyright (c) Special Man Global Solution LTD.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased] - Release Date

[1.0.0] - 2025-03-04

Added

  • Authentication
  • Accounts
  • Verification
  • Transfers

[1.0.1] - 2025-05-08

Added

  • Automatic token refresh

Fixed

  • Token expiry