@9d9dev/sdk
v0.1.0
Published
TypeScript SDK for 9d9 — hosting for AI-built websites
Readme
@9d9dev/sdk
TypeScript SDK for 9d9 — static-site hosting + headless CMS for the websites AI agents build.
import { Client } from "@9d9dev/sdk";
const c = new Client({ apiKey: process.env.NINEDENINE_API_KEY });
// Static-site deploy (the same flow the CLI uses).
const { deploy } = await c.createDeploy(orgId);
await c.uploadDeployFile({
orgId, deployId: deploy.id, path: "index.html",
body: "<h1>Hello</h1>", contentType: "text/html; charset=utf-8",
});
await c.commitDeployManifest(orgId, deploy.id, {
files: [{ path: "index.html", size: 14, hash: "…", mime: "text/html" }],
});
await c.activateDeploy(orgId, deploy.id);
// Headless CMS reads (no auth, public): your static site fetches these.
await fetch(`https://api.9d9.dev/v1/sites/${orgId}/public/pages/home`);For pushing a directory of files use the CLI:
npx @9d9dev/cli deploy ./dist