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
Requirements
- Safe Haven OAuth2 Client ID.
- Safe Haven OAuth2 Client Assertion.
- Node JS v18 or higher.
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
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.