Skip to main content

Client SDK

The Dubhe Client SDK provides a powerful TypeScript interface for connecting your frontend applications to Dubhe Engine smart contracts on Sui.

Installation

Install the client SDK in your frontend project:
npm
yarn

Quick Setup

Initialize the client in your application:

Authentication

Connect a wallet to enable transactions:

Reading Data

Query component data from your entities:

Writing Data (Transactions)

Execute systems to modify game state:

Real-time Updates

Subscribe to entity changes:

Error Handling

Handle common errors gracefully:

Client Configuration

Customize client behavior:

Type Safety

The SDK provides full TypeScript support with auto-generated types:

React Integration

Use React hooks for seamless integration:

Performance Tips

Optimization Strategies
  1. Batch Queries: Group multiple component queries together
  2. Selective Subscriptions: Only subscribe to components you actively display
  3. Pagination: Use pagination for large entity lists
  4. Caching: Enable caching for frequently accessed data

API Reference

Core Methods

Configuration Options

Next Steps

Tutorial: First DApp

Build your first frontend application

Query Guide

Learn advanced querying techniques