Skip to main content
Node 20+, Bun, Deno (npm:) or any runtime with fetch. Zero dependencies, ESM. Use it server-side (build step, backend, script): it sends the workspace’s secret key. On the site itself use the nd.js blocks.

One workspace

Options: apiKey (required), apiUrl (default https://api.neuraldraft.io/v1), userAgent, timeout (ms), fetch.

Several workspaces

One key per client workspace. The format matches @neuraldraft/mcp 0.4 (NEURALDRAFT_API_KEYS), so one .env serves both.
get(name) returns a normal NeuralDraftClient (created once, reused). fromEnv falls back to a single NEURALDRAFT_API_KEY as workspace default.

Site texts

The blocks your client edits in Website → Edit site or by chat (Editable markup).
Only existing keys change (others come back in unknown; pass createMissing: true to create them). Live at once, no redeploy, free. Lower level: content.list({ lang, search, page_size }), content.get, content.set(key, value, lang), content.translate(key, langs) (10 credits per language), content.delete.

Resources

Examples

Errors

Non-2xx responses throw ApiError (status, path, body with the raw JSON). status: 0 is a network failure or timeout.
Lists return { data, meta: { page, page_size, total, last_page } }. Source and changelog: github.com/vbalagovic/neuraldraft-sdk.