zh-web-sdk
TypeScript icon, indicating that this package has built-in type declarations

2.10.6 • Public • Published

ZeroHash Platform SDK

This SDK (Software development Kit) exposes functionality that allows platforms to integrate with ZeroHash on the web and mobile. You should be able to access different UI flows, such as Crypto Buy, Crypto Sell, Crypto Withdrawals, Fiat Deposits, Fiat Withdrawals and Onboarding using a single instance of ZeroHashSDK.

SDK Methods

import { AppIdentifier } from 'zh-web-sdk'

sdk.openModal({appIdentifier: AppIdentifier.ONBOARDING, jwt: jwt})
sdk.openModal({appIdentifier: AppIdentifier.ONBOARDING})

sdk.closeModal(AppIdentifier.ONBOARDING)

sdk.setJWT({ jwt: jwt, appIdentifier: AppIdentifier.ONBOARDING })

sdk.isModalOpen(AppIdentifier.ONBOARDING)

See the ZeroHashSDK class in index.d.ts in /dist.

Quick Setup

import React from 'react';
import ZeroHashSDK, { AppIdentifier } from 'zh-web-sdk';

const App = () => {
  const sdk = new ZeroHashSDK({
    // For cert use "https://web-sdk.cert.zerohash.com"
    zeroHashAppsURL: "https://web-sdk.zerohash.com", 
    // JWT can be set later, when opening the Modal using `openModal` method
    cryptoBuyJWT: "<JWT_TOKEN_HERE>" 
  });

  sdk.openModal({appIdentifier: AppIdentifier.CRYPTO_BUY})
  return <></>;
}

export default App;

Versioning

The ZeroHash SDK uses Semantic Versioning 2.0.0. Version numbers follow the MAJOR.MINOR.PATCH format:

  • MAJOR version increments when we make incompatible API changes (e.g., 1.0.0 to 2.0.0).
  • MINOR version increments when we add new functionality in a backward-compatible manner (e.g., 1.0.0 to 1.1.0).
  • PATCH version increments when we make backward-compatible bug fixes (e.g., 1.0.0 to 1.0.1).

Mobile Usage

For more details on how to use it on mobile apps, please refer to our full documentation: ZeroHash SDK Documentation.

Readme

Keywords

none

Package Sidebar

Install

npm i zh-web-sdk

Weekly Downloads

812

Version

2.10.6

License

MIT

Unpacked Size

839 kB

Total Files

62

Last publish

Collaborators

  • zerohash