Overview
This guide explains how to integrate the Zero Hash SDK with mobile applications. The integration is done via a WebView that calls our proxy service, sdk-mobile
, with the necessary parameters.
Integration Steps
1. Open WebView with SDK-Mobile Proxy
To integrate the Zero Hash SDK into your mobile application, you need to open a WebView and navigate to the sdk-mobile
proxy service. The URL must include the following parameters:
zeroHashAppsURL
: The base URL for Zero Hash applications.- Possible options are:
- Certification (cert):
https://web-sdk.cert.zerohash.com
- Production (prod):
https://web-sdk.zerohash.com
- Certification (cert):
- Possible options are:
- One of the following JWT parameters:
fiatWithdrawalsJWT
fiatDepositsJWT
cryptoBuyJWT
cryptoSellJWT
cryptoWithdrawalsJWT
userOnboardingJWT
fundJWT
profileJWT
cryptoAccountLinkJWT
For more information on how to generate the JWT, please refer to our JWT documentation
2. Example URL Format
Certification Environment (For Testing & Development):
Our sdk-mobile
is hosted under https://sdk-mobile.zerohash.com/v1
, so use this URL when working in a test or development environment.
Here's an example URL:
https://sdk-mobile.cert.zerohash.com/v1?zeroHashAppsURL=https://web-sdk.cert.zerohash.com&<selectedJWT>=<your_jwt_token>
Production Environment (For Live Deployments):
Use this URL when deploying in a live production environment:
https://sdk-mobile.zerohash.com/v1?zeroHashAppsURL=https://web-sdk.zerohash.com&<selectedJWT>=<your_jwt_token>
⚠ Important: Ensure that you are using the correct URL based on your environment. The Certification Environment is meant for testing purposes only, while the Production Environment should be used for actual user transactions. The zeroHashAppsURL
you send should match your selected sdk-mobile
environment, otherwise the integration will not work properly.
3. Handling the WebView
Ensure that your mobile application handles WebView navigation securely and correctly passes the required parameters/permissions. The WebView should support JavaScript execution. Here are the guide for integrating with modern tools:
You'll notice that on all guides above there's an appIdentifier
attribute on them. Here's all the possible values for them (column App Identifier postMessage), use according to the product you want to invoke on your application.
Product | App Identifier (postMessage) | JWT Identifier (to get JWT) | sdk-mobile (to use on sdk-mobile url) | zh-web-sdk (to use on ZeroHashSDK class) |
---|---|---|---|---|
Onboarding | onboarding | onboarding | userOnboardingJWT | userOnboardingJWT |
Profile | profile | participant-profile | profileJWT | profileJWT |
Crypto Account Link | crypto-account-link | crypto-account-link | cryptoAccountLinkJWT | cryptoAccountLinkJWT |
Crypto Buy | crypto-buy | crypto-buy | cryptoBuyJWT | cryptoBuyJWT |
Crypto Sell | crypto-sell | crypto-sell | cryptoSellJWT | cryptoSellJWT |
Crypto Withdrawals | crypto-withdrawals | crypto-withdrawals | cryptoWithdrawalsJWT | cryptoWithdrawalsJWT |
Fiat Deposits | fiat-deposits | fiat-deposits | fiatDepositsJWT | fiatDepositsJWT |
Fiat Withdrawals | fiat-withdrawals | fiat-withdrawals | fiatWithdrawalsJWT | fiatWithdrawalsJWT |
Fund | fund | fwc | fundJWT | fundJWT |
Fund Withdrawals | crypto-withdrawals | crypto-withdrawals | cryptoWithdrawalsJWT | cryptoWithdrawalsJWT |
Additional Considerations
- Always use HTTPS for secure communication.
For more details, refer to the Zero Hash API documentation or contact support.