Getting started

Introduction

What the HydraOne SDK is, how it runs inside and outside the App Center, and where to go next.

@hydraone-sdk/core connects games and dApps to the HydraOne App Center on Cardano. It gives you a wallet bridge (CIP-30), CIP-8 login with JWT sessions, storage that survives Safari restrictions, and adapters for React and Vue.

What you get

  • Wallet bridge. Query addresses and balances, sign and submit transactions, without ever touching private keys.
  • Host features. Theme and audio events, orientation, haptics and the deposit modal.
  • Framework adapters. HydraOneProvider and hooks for React and Next.js, composables and a plugin for Vue and Nuxt.
  • Diagnostics. A health check that finds the common integration problems and says how to fix them.

Where the game runs

The game runs in an iframe inside the HydraOne App Center. The wallet lives in the host shell, and the game reaches it over postMessage, so the game never holds a private key. The host side is provided by @hydraone-sdk/host.

See Architecture for the full picture.

Entry points

One package, several entry points. Import only what you need; sideEffects: false lets bundlers drop the rest.

Entry pointContents
@hydraone-sdk/coreClient, transports, storage adapters, auth, errors, types and diagnostics. About 23 KB gzipped.
@hydraone-sdk/core/reactHydraOneProvider, useWallet, useHostStorage.
@hydraone-sdk/core/vueuseWalletBridgeClient, createHydraOne and shared-instance setters.

react and vue are optional peer dependencies and are never bundled.

Where to go next

API reference

The API reference is generated from the TSDoc comments in src/ with TypeDoc and is not committed. Build it with:

pnpm run docs:api

The output is written to packages/core/docs/api/. Open docs/api/index.html in a browser.