Skip to content

Generation types

A Verament request names what to generate. There are five generation types:

Type What Verament generates Example prompt
schema Tables, columns, relationships and indexes “A blog with posts, comments and tags; posts belong to users”
storage Storage buckets and their access rules “A private avatars bucket where each user can write only their own folder”
functions Functions for your business logic “A function that sends a welcome email when a user signs up”
backend A server-side project built on your VAIF backend “An API for a project-management app with teams, projects and tasks”
fullstack Server code and a frontend together “A task board with a React frontend and live updates”

Which types you can generate depends on your plan. Backend generation is on Starter, Pro, Agency, Studio+ and Enterprise, and function generation is on Starter, Pro, Agency, Studio+ and Enterprise. See Plans.

In the console, Verament picks the types from your prompt. With @vaifstudio/client you name them. A build request answers with the plan card, and nothing is built until you confirm it:

import { createVaifClient } from "@vaifstudio/client";
const vaif = createVaifClient({
baseUrl: "https://api.vaif.studio",
accessToken: process.env.VAIF_ACCESS_TOKEN,
});
const message = "Create a users table with email and name";
const planned = await vaif.copilot.chat({
projectId: "your-project-id",
message,
generationTypes: ["schema"],
});
if (planned.preflightRequired?.kind === "plan") {
const { plan } = planned.preflightRequired;
console.log(plan.files, plan.planningCredits, plan.maximumCredits);
const built = await vaif.copilot.confirmPlan({
projectId: "your-project-id",
sessionId: planned.sessionId,
planId: plan.planId,
message,
generationTypes: ["schema"],
});
if ("build" in built) console.log(built.response.artifacts.files);
}
// Automation: build in one call when the whole run costs at most 200 credits.
await vaif.copilot.chat({
projectId: "your-project-id",
message,
generationTypes: ["schema"],
autoConfirm: { maxCredits: 200 },
});

accessToken is a console access token; see Access tokens.

A backend or fullstack result is a workspace. Download it with vaif workspace pull --session <id> --output <dir>.

Every generation spends Verament credits.