Schema Versioning
Schema versions let you run separate content environments — one for production, one for staging or a feature branch — without conflicting field definitions or content values.
The default version
Every workspace uses "default" as the production schema version unless you specify otherwise. All content your client edits in the dashboard is stored under this version.
Why you’d use versions
Imagine you’re adding a new section to a client’s site on a feature branch. If you deploy that branch to a preview URL, Vard would normally overwrite the production schema with your new fields. Schema versions prevent this.
Setting a version
Pass a version option when creating your client:
lib/vard.ts
import { createVardNext } from "@vard-app/sdk/next";
export const vard = createVardNext({
apiKey: process.env.VARD_API_KEY,
version: process.env.VARD_SCHEMA_VERSION ?? "default",
});Then set the version per environment:
.env.production
VARD_SCHEMA_VERSION=default.env.preview
VARD_SCHEMA_VERSION=stagingHow versions work
- Each version has its own set of field definitions (schema)
- Each version has its own set of content values
- The dashboard shows a version switcher when multiple versions exist
- Publishing content in one version does not affect other versions
Recommended workflow
- Use
"default"for production - Use a branch name (e.g.
"feat-new-section") for feature branches - Merge and delete the version when the branch lands in production
Last updated on