HiveXPH SDKhivexph-sdk
NPM
Developer toolkit for Hive Custom JSON and Hive Engine transactions.

Reference

Node vs browser

One package, two writing paths. Everything that reads the chain runs anywhere; signing is either backend keys or the Hive Keychain extension.

Matrix

FeatureNode / workersBrowserNotes
hive.rpcYesYesfetch only
hive.beaconYesYesNode discovery
hive.reader.transaction()YesYesRead by id
hive.blocks.watch()YesYesAsync generator
hive.customJson.watch()YesYesAsync generator
hive.payments.watch()YesYesAsync generator
hive.payments.validate()YesYesRead-only
hive.builder / hive.parserYesYesPure functions
hive.keychainNoYesKEYCHAIN_UNAVAILABLE elsewhere
hive.keychainIssuerNoYesKEYCHAIN_UNAVAILABLE elsewhere
hive.issuerYesNoBackend only — reads key env vars

Security

Backend issuing reads private keys from environment variables. Never bundle a configuration with keyEnv into browser code — use hive.keychainIssuer there.

Runtimes

Node 18+, Bun, Deno, Cloudflare Workers and every modern browser are supported. The SDK uses global fetch, reads process.env only through a guarded resolver, and touches no DOM API at module scope, so importing it during server rendering is safe.

TypeScript
// Browser-only calls fail predictably instead of throwing ReferenceError.
try {
  await hive.keychain.customJson({ username: "alice", id: "my-app", action: "claim" });
} catch (error) {
  // error.code === "KEYCHAIN_UNAVAILABLE" on the server
}

Package shape

ESM only, one entry point (hivexph-sdk), bundled type declarations, no side effects on import: constructing a client opens no connection and starts no stream.