Skip to content

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:

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:

  1. Create a new project folder by executing the following command in the terminal:

    mkdir datahaven-project && cd datahaven-project
    
  2. Initialize a package.json file using the correct command for your package manager:

    pnpm init
    
    yarn init
    
    npm init --y
    
  3. Add the TypeScript and Node type definitions to your projects using the correct command for your package manager:

    pnpm add -D typescript ts-node @types/node
    
    yarn add -D typescript ts-node @types/node
    
    npm install -D typescript ts-node @types/node
    
  4. Create a tsconfig.json file in the root of your project and paste the following configuration:

    tsconfig.json
    {
        "compilerOptions": {
            "target": "ES2022",
            "module": "nodenext",
            "moduleResolution": "NodeNext",
            "esModuleInterop": true,
            "strict": true,
            "skipLibCheck": true,
            "outDir": "dist",
            "declaration": true,
            "sourceMap": true
        },
        "include": ["src/**/*.ts"]
    }
    
  5. Initialize the src directory:

    mkdir src && touch src/index.ts
    

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.

pnpm add @storagehub-sdk/core @storagehub-sdk/msp-client
yarn add @storagehub-sdk/core @storagehub-sdk/msp-client
npm install @storagehub-sdk/core @storagehub-sdk/msp-client

Next Steps

Now that you have the StorageHub SDK packages installed, you are ready to start building with DataHaven.

Last update: November 11, 2025
| Created: September 18, 2025