Skip to main content
A preset is a reusable render configuration — background, subtitle style, layout — that you can apply to any project or export. Use presets when you have a consistent look across many tracks. See Render settings reference for the full preset shape and every enum-backed option.

client.presets.list(options?)

List every preset owned by the authenticated account.
const presets = await client.presets.list();
presets.forEach((p) => console.log(p.id, p.name, p.isDefault));

client.presets.get(presetId, options?)

Fetch a single preset.
const preset = await client.presets.get("preset_abc123");

client.presets.create(body, options?)

Create a new preset.
const preset = await client.presets.create({
  name: "Neon Night",
  preset: {
    background: {
      type: "gradient",
      colors: ["#12001f", "#2f0a57"],
      angle: 90,
    },
    singerTextStyles: {
      0: {
        fontFamily: "Inter",
        textColor: "#00f5ff",
        effectColor: "#ff4fd8",
      },
    },
  },
  isDefault: false,
});
name
string
required
Display name shown in the Youka UI.
preset
KaraokePreset
required
The full preset body. Use Render settings reference for the human-readable field map, or KaraokePresetSchema.toJSONSchema() for the machine-readable schema.
isDefault
boolean
Mark the new preset as the account default. Only one preset can be the default at a time.
Pair with an idempotency key for safe retries:
const preset = await client.presets.create(body, {
  idempotencyKey: "create-neon-night-v1",
});

client.presets.update(presetId, body, options?)

Patch an existing preset. Pass any subset of name, preset, and isDefault.
const updated = await client.presets.update("preset_abc123", {
  name: "Neon Night v2",
  preset: {
    singerTextStyles: {
      0: { textColor: "#ff2a2a" },
    },
  },
});

client.presets.delete(presetId, options?)

Delete a preset.
await client.presets.delete("preset_abc123", {
  idempotencyKey: "delete-preset_abc123",
});
Deleting a preset does not delete projects or exports that were previously rendered with it. Future exports that reference the deleted preset will fail.

client.presets.setDefault(presetId, options?)

Mark a preset as the default for new projects. This is a convenience wrapper around client.presets.update(presetId, { isDefault: true }).
await client.presets.setDefault("preset_abc123");
Setting a new default automatically unsets the previous one.

Discovering valid fields

The SDK exports the Zod schema that validates preset bodies. Convert it to JSON Schema at runtime for agents and form builders:
import { KaraokePresetSchema } from "@youka/sdk";

const jsonSchema = KaraokePresetSchema.toJSONSchema();
console.log(jsonSchema);
Agent authors: call this schema before mutating presets so the model knows the exact field names and value types.
Human-readable reference:

Applying a preset

Apply presets at three points:
await client.projects.create({
  source: { type: "path", path: "./song.mp3" },
  presetId: "preset_abc123",
});

What’s next