Installing Sui SDK and dApp Kit
This guide will walk you through setting up the workshop project and installing all the necessary Sui packages.Clone the Workshop Repository
First, clone the workshop starter repository:Install Dependencies
The project uses npm for package management. Install the existing dependencies:Install Sui Packages
Now add the Sui-specific packages to the project:- @mysten/dapp-kit - React components and hooks for Sui dApps
- @mysten/sui - Core Sui TypeScript SDK
- @tanstack/react-query - Required for data fetching (peer dependency)
Verify Installation
After installation, verify the packages were added to yourpackage.json:
Package Overview
@mysten/dapp-kit
The dApp Kit provides:- React Hooks for wallet interactions, transactions, and queries
- UI Components like
ConnectButtonandConnectModal - Provider Components for managing state
- Type-safe APIs for blockchain interactions
WalletProvider- Manages wallet stateSuiClientProvider- Manages network connectionsuseCurrentAccount()- Get connected wallet accountuseSignAndExecuteTransaction()- Sign and execute transactionsuseSuiClientQuery()- Query blockchain dataConnectButton- Pre-built wallet connection UI
@tanstack/react-query
React Query is a peer dependency that powers the data fetching hooks in dApp Kit:- Automatic caching and refetching
- Loading and error states
- Optimistic updates
- Request deduplication
Package Versions
Always use compatible versions of
@mysten/dapp-kit and @mysten/sui. They
are versioned together and should typically be on the same version number.Next Steps
Now that you have all the packages installed, let’s set up the providers to connect your app to the Sui blockchain.Setup Providers
Configure network and wallet providers