zh-web-sdk
v2.12.6
Published
ZeroHash Web SDK
Downloads
11,918
Readme
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.0to2.0.0). - MINOR version increments when we add new functionality in a backward-compatible manner (e.g.,
1.0.0to1.1.0). - PATCH version increments when we make backward-compatible bug fixes (e.g.,
1.0.0to1.0.1).
Mobile Usage
For more details on how to use it on mobile apps, please refer to our full documentation: ZeroHash SDK Documentation.
