---
updatedAt: 2026-06-26T14:01:17.000Z
agentTools:
  projectIndex: https://docs.zerohash.com/llms.txt
---

# Fund

Use this developer guide for an efficient integration to the Fund SDK

See core product page [here](https://docs.zerohash.com/docs/fund-overview)

## Acquire Access Token

To invoke the Fund SDK, you'll need to acquire an access token using `fwc` permission. Please see endpoint API Reference [here](https://docs.zerohash.com/reference/post_client-auth-token). After obtaining the access token, you can start using the SDK.

## Web Application

We recommend to first read our [Overview](https://docs.zerohash.com/reference/sdk-overview), [Installation](https://docs.zerohash.com/reference/sdk-instalation) and [Getting Started](https://docs.zerohash.com/reference/sdk-getting-started) guides.

Example using React:

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

const App = () => {
  const sdk = new ZeroHashSDK({
    zeroHashAppsURL: "https://web-sdk.cert.zerohash.com", //prod: https://web-sdk.zerohash.com
    fundJWT: "<JWT_TOKEN_HERE>" 
  });

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

export default App;
```

For a line by line explanation on how to integrate, please take a look at the following guide:

<Recipe slug="web-sdk-integration" title="Web SDK Integration" />

## Mobile Application (WebView)

To use our SDK on mobile apps, you don't need to install or include `zh-web-sdk` as a dependency in your project. We use a proxy server that calls the SDK internally to make it work for mobile applications. For more info, head to our [Integration with Mobile Apps](https://docs.zerohash.com/reference/sdk-integration-with-mobile-apps) page and select the platform you're using to build your app.

### Events

We forward events from the UI to the native app using the postMessage API. You can handle these events from the WebView component. Currently, these are the events we have:

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Message
      </th>

      <th>
        Meaning
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        SDK\_MOBILE\_READY
      </td>

      <td>
        The SDK is ready to receive postMessage events (e.g OPEN\_MODAL)
      </td>
    </tr>

    <tr>
      <td>
        FUND\_APP\_LOADED
      </td>

      <td>
        The SDK is loaded and visible to the customer.
      </td>
    </tr>

    <tr>
      <td>
        FUND\_CLOSE\_BUTTON\_CLICKED
      </td>

      <td>
        The close (X) button was clicked in the top right corner of the UI.
      </td>
    </tr>

    <tr>
      <td>
        FUND\_COMPLETED
      </td>

      <td>
        The Fund submitted by the customer resulted in a successful transaction and a "Transaction confirmed" page was displayed to the user.

        The payload of this event is: `type: "FUND_COMPLETED", transactionId: <TRANSACTION_ID>, fundId: <FUND_ID>`
      </td>
    </tr>

    <tr>
      <td>
        FUND\_FAILED
      </td>

      <td>
        The Fund submitted by the customer resulted in a failed transaction and a "Transaction failed" page was displayed to the user.

        The payload of this event is: `type: "FUND_FAILED", transactionId: <TRANSACTION_ID>, fundId: <FUND_ID>`
      </td>
    </tr>

    <tr>
      <td>
        TOKEN\_EXPIRED
      </td>

      <td>
        The token is expired and needs to be refreshed. See [Acquire Access Token](https://docs.zerohash.com/reference/retrieving-access-token) to refresh it.
      </td>
    </tr>
  </tbody>
</Table>

### Messages

To control the WebView, you can also send messages using the postMessage API after receiving `SDK_MOBILE_READY` from WebView. Currently, the accepted messages are:

#### Open Modal

Opens the modal with the JWT provided for identifier provided.

```json
{type: "OPEN_MODAL", payload: {jwt: "<JWT_HERE>", appIdentifier: "fund-with-crypto"}}
```

#### Close Modal

Closes the modal for identifier provided.

```json
{type: "CLOSE_MODAL", payload:{appIdentifier: "fund-with-crypto"}}
```

For more details on how to use our SDK with WebViews, please refer to [Integration with Mobile Apps](https://docs.zerohash.com/zerohash/reference/sdk-integration-with-mobile-apps)