Quickstart: JavaScript
@hyphae/cloud lives in sdks/js/ of the repository (it is not on a registry yet; use it as a workspace or file: dependency). It has zero runtime dependencies, targets Node 22+ and modern browsers, and is a client, not an authority: it holds your token, calls the routes, and returns the server’s fields unchanged.
import { CloudError, createCloudClient } from "@hyphae/cloud";
const cloud = createCloudClient({ url: "https://infra-hyphae.run" });
await cloud.auth.signup({ email: `dev-${Date.now()}@example.com`, password: "phase0-password", invite_code: process.env.INVITE_CODE });const project = await cloud.projects.create({ name: "quickstart" });await cloud.projects.wakeup(project.id);
const issued = await cloud.keys.create(project.id, { label: "quickstart" }); // secret shown onceconst data = cloud.data(project.id, { key: issued.key }); // the key planeconst caps = await data.capabilities();if (caps.decoded.kind === "capabilities") { const c = caps.decoded.value; console.log(`${project.id}: engine api v${c.product_api_version}, max_sql_rows ${c.max_sql_rows}`);}
try { await cloud.snapshots.create(project.id); // needs the tenant asleep} catch (e) { if (e instanceof CloudError && e.isTenantRunning) await cloud.projects.sleep(project.id); else throw e;}const snap = await cloud.snapshots.create(project.id, { label: "first" });console.log(`snapshot ${snap.id} at visible_csn ${snap.lineage.visible_csn} (${snap.backup.status})`);Two clients, two planes: cloud.* uses your session (owner routes and everything below); cloud.data(projectId, { key }) uses a project key and exposes only what a key may do — capabilities(), storage, publish/subscribe, invoke, and raw(path) for any /v2 request. It deliberately has no secrets.
Surface and errors: SDK reference.