Schema Configuration
Use defineConfig() in flexkit.config.ts to register one project or multiple projects. The file is pure data: it exports entities, attributes, scopes, spaces and menu groups, and nothing else. flexkit deploy reads it, serializes it and sends it to the project; the Studio then renders the deployed configuration.
Each project configuration should define a scopes array. At least one scope should be marked with isDefault: true.
Single Project
import { defineConfig } from '@flexkit/schema';
import { products } from './schema/products';
import { categories } from './schema/categories';
export default defineConfig({
title: 'Commerce',
projectId: 'commerce123',
menuGroups: [
{ name: 'catalog', title: 'Catalog' },
{ name: 'operations', title: 'Operations' },
],
scopes: [
{ name: 'default', label: 'Default', isDefault: true },
{ name: 'es', label: 'Spain' },
{ name: 'fr', label: 'France' },
],
schema: [products, categories],
});Multiple Projects
import { defineConfig } from '@flexkit/schema';
import { crmDeals } from './schema/crm/deals';
import { crmContacts } from './schema/crm/contacts';
import { erpSuppliers } from './schema/erp/suppliers';
export default defineConfig([
{
title: 'CRM',
projectId: 'crm123',
scopes: [
{ name: 'default', label: 'Global', isDefault: true },
{ name: 'na', label: 'North America' },
{ name: 'emea', label: 'EMEA' },
],
schema: [crmDeals, crmContacts],
},
{
title: 'ERP',
projectId: 'erp123',
scopes: [
{ name: 'default', label: 'Default', isDefault: true },
{ name: 'warehouse-a', label: 'Warehouse A' },
{ name: 'warehouse-b', label: 'Warehouse B' },
],
schema: [erpSuppliers],
},
]);flexkit deploy starts one deploy job per project in the array.
Defining Scopes
Scopes are configured at the project level, not on individual entities.
- Add a
scopeskey next toprojectId,menuGroups,spaces, andschema. - Define at least one scope with
isDefault: true. - Use
scope: 'local'on attributes that should store different values per selected scope. - When a local value is missing in the selected scope, the default scope value is used.
Config Fields
title?: stringStudio title shown in the navbar. Falls back to the project name from the Dashboard.projectId: stringunique project identifier.menuGroups?: { name: string; title: string }[]sidebar sections. Entities join one throughentity.menu.group; amenu.groupthat is not declared here is rejected at deploy.scopes: { name: string; label: string; isDefault?: boolean; sortOrder?: number }[]data variants (markets, channels). See Scopes.spaces?: { code: string; label: string }[]permission spaces; deploy before assigning membership.schema: Entity[]list of entities created withdefineEntity.
There is no basePath, extensions, commands or icon key. The path the Studio is mounted on is a property of the <FlexkitStudio> component in your app (basename), not of the schema, and the Studio UI is no longer extended from the config: extend behaviour through custom tools, skills and automations instead.
The file
- The config must be
flexkit.config.ts(.jsand.mjsare also accepted). Aflexkit.config.tsxis refused by the CLI with migration guidance: rename it to.ts, replace icon components with lucide icon names such as'Tag', use booleans forhiddenandreadOnly, and removeextensions,basePathandcommands. import { defineConfig, defineEntity } from '@flexkit/schema'. Both helpers are also re-exported by@flexkit/studio.- Export the result of
defineConfig()as the default export.
The Studio fetches the deployed schema for each project after login. Editing the config file changes nothing on
screen until you run flexkit deploy. A project that has never been deployed shows a “No deployed
schema” screen.
See deployment for the server/application boundary and schema deployment and migrations for changing a live schema safely.