Introduction
Hydra SDK is a TypeScript toolkit for building Cardano wallet applications with Hydra Layer 2 integration. It wraps the cardano-serialization-lib WASM bindings and the Hydra Head protocol behind a modular, type-safe API — delivering native-level performance in the browser while staying compatible with modern build tools like Vite and Rollup.
Why Hydra SDK?
- WASM-powered — the core runs on
cardano-serialization-libcompiled to WebAssembly, up to 10× faster than JavaScript-based SDKs. - Zero bundle issues — no polyfills for
util,stream, orcrypto. Works out of the box with Vite, Rollup, Nuxt 3, React + Vite, and Next.js. - Browser-first — designed for DApps, with an environment-aware WASM loader that also runs on Node.js.
- Modular — install only the packages you need; each ships ESM + CJS.
- Type-safe — comprehensive TypeScript definitions across every namespace and builder.
Prerequisites
Before you begin, make sure you have:
- Node.js 18.20.0 or higher
- A package manager — npm, pnpm, or yarn
- Basic TypeScript / JavaScript knowledge
- Familiarity with core Cardano concepts (addresses, UTxOs, transactions)
Architecture
The SDK is a monorepo of four packages that build on each other:
| Package | Responsibility |
|---|---|
@hydra-sdk/core | HD wallet creation & management, UTxO types, Cardano utilities |
@hydra-sdk/bridge | Hydra Head lifecycle over WebSocket + REST |
@hydra-sdk/transaction | Low-level TxBuilder for Layer 1 and Hydra |
@hydra-sdk/cardano-wasm | Environment-aware WASM bindings |
graph LR
A[Your App] --> B[core]
A --> C[bridge]
A --> D[transaction]
B --> E[cardano-wasm]
C --> B
C --> E
D --> B
D --> E
All packages import Cardano primitives through @hydra-sdk/cardano-wasm — never import @emurgo/cardano-serialization-lib directly.
Development workflow
A typical flow when building with the SDK:
Install packages
Add the SDK packages your app needs.
Create a wallet
Initialize an AppWallet (or EmbeddedWallet / CardanoCLIWallet) instance.
Connect to a network
Connect to a Cardano network and/or a Hydra Node.
Build & sign transactions
Compose transactions with the TxBuilder and sign them with the wallet.
Submit
Submit to the Cardano network or into an open Hydra Head.
Next steps
Need help? Report issues on GitHub or start a discussion.
