Skip to Content
Technical referenceStudio reference

Studio reference

Import client APIs from @flexkit/studio. Mount components that use Studio hooks beneath FlexkitStudio; they rely on its project, authentication, routing, and data providers. Studio renders the schema deployed to each project; it does not import flexkit.config.ts.

Component and configuration

ExportPurpose
FlexkitStudioRender Studio. With projectIds: string[] it opens those projects; without it it runs in hosted mode (login once, every accessible project). Pass basename when mounted under a path.
defineConfig, defineEntityAuthor flexkit.config.ts; re-exported from @flexkit/schema.
useConfigmode, apps, currentProjectId, currentProject, currentProjectSchema, projects, projectIds, projectSummaries, schemaErrors, isLoadingSchemas.
useAuthSigned-in authentication context.
useAppContext, useAppDispatchStudio application state, including scope context.
useCanMutate, canMutateDataUI mutation eligibility; server authorization still applies.
canAccessSpaces, filterEntitiesForSpaces, filterAttributesForSpacesSpace-aware UI filtering.
Outlet, useLocation, useParamsRouting inside components rendered under FlexkitStudio.

useConfig().projects contains only projects whose deployed schema loaded; projectIds lists every id the Studio can open, and schemaErrors explains each id that could not load (not deployed, or no access).

mode is 'projects' when the host passed projectIds and 'hosted' otherwise. In hosted mode the Studio loads the signed-in user’s projects itself, projectSummaries holds their names, avatars, roles and teams before any schema is fetched, schemas are fetched per visited project, and the last opened project is remembered in the browser. The host’s API route must proxy /api/flexkit/-/… to the user-level Flexkit API, which the framework adapters do; see hosted Studio.

Data hooks

useEntityQuery accepts entity plural name, schema, scope, variables, optional isForm, and selection mode. It returns count/data, loading states, fetchMore, reload, project restriction flags, and a schema-error message. Use its pagination lifecycle rather than guessing completion from a single page.

useEntityMutation returns setters for the run flag, mutation document, and options, followed by result/loading/error and restriction state. It is not the same signature as Apollo’s ordinary mutation hook. Use the installed type declarations when integrating it.

useRefreshEntityList and usePatchEntityList support list refresh/update after changes. useUploadAssets handles application uploads; useSearch supplies mapped search results. Query builders include getEntityQuery, getEntityCreateMutation, getEntityUpdateMutation, getEntityDeleteMutation, and getEntityDeleteWhere.

Types and UI exports

Public types include FlexkitStudioProps, ProjectUiConfig, ProjectSchemaError, the authoring types Config, ProjectConfig, Entity, Attribute, Schema, FieldGroup, EntityMenu, MenuGroup, and ZodValidation, the deployed-schema types UiEntity, UiAttribute, UiProjectSchema, and ProjectSchemaResponse, the AI types (Automation, Skill, AgentChat, and related), plus FormFieldValue and mapped entity types. The package also exposes table components and selected table/virtualization helpers for custom lists. Use their installed declarations for component props and preserve loading, selection, and accessibility behavior.

defineExtension, StudioExtension, StudioContributions, FormFieldProps, and AppOptions are no longer exported: Desk, Asset Manager, Explorer, and AI are built in, and the Studio UI is not extended from code. Extend Flexkit through custom tools, skills, automations, and the GraphQL API; see extending Flexkit.

See schema configuration for project options and compatibility before upgrades.

Last updated on