Get Started with the StorageHub SDK¶
The StorageHub SDK is a modular toolkit that makes it easy to build on DataHaven, giving developers direct access to functionalities for managing storage, buckets, and proofs. It simplifies both on-chain and off-chain interactions so you can focus on your application logic rather than low-level integrations.
This guide introduces and compares the functionalities of the StorageHub SDK packages. You'll also find prerequisites for using DataHaven and StorageHub SDK installation instructions.
StorageHub SDK Packages¶
The StorageHub SDK contains the following packages:
Package |
Description | When to Use | Environments |
|---|---|---|---|
@storagehub-sdk/core |
Foundational, backend-agnostic building blocks for StorageHub. | Chain-facing interactions | Node.js, Browsers |
@storagehub-sdk/msp-client |
High-level client for interacting with Main Storage Provider (MSP) services. | Provider-facing operations | Node.js, Browsers |
@storagehub-sdk/core
The primary functions of @storagehub-sdk/core are to act as backend-agnostic building blocks including:
- Wallets and signing
- EIP-1193
- Precompile helpers for bridging between Substrate and EVM
- Merkle and WASM utilities
- Low-level HTTP
- Types and constants shared across the SDK.
This package includes EVM account-typed helpers, WASM-backed file utilities, and stable primitives usable without any backend.
@storagehub-sdk/msp-client
The primary functions of @storagehub-sdk/msp-client are as follows:
- Retrieve MSP-specific client information, such as:
- Health
- Authorization nonce/verify
- Upload and download endpoints
- Talk to an MSP backend for authorization and file transfer.
- Includes REST contracts for MSP, token handling, and streaming or multipart upload and download helpers.
This package includes all MSP-tied logic.
Prerequisites¶
Before you begin, ensure you have the following:
- Node.js ≥ 22 installed. LTS version recommended.
- pnpm, npm, or yarn installed for package management
- Network configuration details, including the RPC and WSS endpoints
- MSP base URL
- Testnet tokens
Need a starter project?
If you don't have an existing project, follow these steps to create a TypeScript project you can use to follow the guides in this section:
-
Create a new project folder by executing the following command in the terminal:
-
Initialize a
package.jsonfile using the correct command for your package manager: -
Add the TypeScript and Node type definitions to your projects using the correct command for your package manager:
-
Create a
tsconfig.jsonfile in the root of your project and paste the following configuration: -
Initialize the
srcdirectory:
Install the StorageHub SDK¶
Add the core and MSP client packages to your project. These libraries provide the APIs and utilities needed to interact with DataHaven’s storage network.
Next Steps¶
Now that you have the StorageHub SDK packages installed, you are ready to start building with DataHaven.
| Created: September 18, 2025