BlitFlow
TypeScript SDK

Nodes & single runs

Discover node specs and run single nodes from the SDK.

Search the palette

import { BlitClient } from "@blitflow/sdk";

const client = new BlitClient({ apiKey: process.env.BLITFLOW_TOKEN });

const specs = await client.searchNodes({
  query: "sprite",
  category: "image",
  limit: 10,
});

All options are optional — omit them to list the whole palette.

Fetch one spec

const spec = await client.getNode("rd-fast");

// The spec's ports tell you exactly what to send:
for (const [name, port] of Object.entries(spec.inputs)) {
  console.log(
    name,
    port.connector.id,
    port.connector.optionValues ?? "",
    port.connector.defaultValue ?? "",
  );
}

Read optionValues before sending enum-like inputs (style, modes, sizes) — values outside the enum fail validation. See Nodes & specs.

Run a single node

For one-off inference, skip the workflow entirely:

const { outputs } = await client.runNode("rd-fast", {
  prompt: "a brass key on black velvet",
  removeBg: true,
  seed: 7,
  // data ports take Artifacts:
  // init: { ref: "https://…/base.png" },
});

console.log(outputs.image); // { kind: "image", ref: "https://…", … }

Scalars (string / number / boolean / null) work for value ports; Artifacts for images and other binary data. The call returns the node's outputs directly — no event stream.

On this page