Studio API reference

Every Studio export in one place, grouped by what it does. Each links to the guide with the full detail. All are imported from @svgrid/enterprise unless noted; createServerDataSource is from @svgrid/grid.

Data sources

Each returns a ServerDataSource - the one contract the grid, form, sorting, filtering, paging, and CRUD all speak.

Function Signature (key options) Guide
createInMemoryDataSource (rows, schema) In-memory
createSqlDataSource ({ schema, table, dialect, execute, returning? }) Databases
createSupabaseDataSource ({ client, table, schema, searchColumns? }) Supabase
createRestDataSource ({ url, schema, headers?, buildQuery?, parse? }) REST & custom APIs
createKitDataSource ({ endpoint }) - the SvelteKit-transport client REST & custom APIs

Controller & transport

Symbol Signature Purpose
createServerDataSource (from @svgrid/grid) (source, { pageSize, optimistic?, getRowId, onChange }) Reactive controller: state, lifecycle, optimistic CRUD. Methods: refresh / setSort / setFilter / setPage / setPageSize / createRow / updateRow / deleteRow. See Data binding.
createKitHandlers ({ schema, source }) -> { POST } Server-side handler for a +server.ts route; one JSON endpoint for read + CRUD.
withEntityRules (source, schema) -> ServerDataSource Wrap a source so computed fields + hooks apply on read/write.

Schema helpers

Function Signature Returns
schemaToColumns (schema) ColumnDef[] for <SvGrid>.
schemaToFormFields (schema) Field descriptors for <SvGridEditPanel>.
resolveIdField (schema) The id field name.
validateField (field, value) Built-in validation result.
applyComputed (schema, row) Row with computed fields materialized.

See The EntitySchema for the model these read.

Components

Component Key props Guide
SvGridEditPanel schema, row, presentation (modal | drawer | inline), onSubmit({ mode, id, values }), onCancel Edit forms
SvGridMasterDetail schema, data, detailSchema, getChildren, containerHeight?, detailHeight? Master-detail
SvSchemaDashboard schema, rows | getAggregate, spec?, refreshKey?, filterModel?, onDrill? Dashboards
SvSchemaChart schema-bound chart (dimension / measure / reduce / type) Dashboards
SvSchemaDesigner schema, onChange?, showPreview? Visual designer
SvStudioDesigner project, onChange? Visual app designer
SvLookupInput / createRelationLookup searchable foreign-key picker over any ServerDataSource Relations
SvAuthGate client, title? Auth

Auth & realtime

Symbol Signature Guide
createSupabaseAuth ({ client, onChange }) -> { signIn, signUp, signOut, getState, dispose } Auth
createSupabaseRealtime live refetch / row-flash on Postgres change streams Real-time
introspectSupabaseTable ({ url, key, table }) -> EntitySchema (reads columns + FKs) Supabase

Designer & project model

Symbol Signature Purpose
createProject (schemas, { title }) -> StudioProject Seed a designer project (one screen per entity).
serializeProject / parseProject (project) / (json) Save / reopen a studio.config.json.
emitStudioProject (project) -> { path, contents, description }[] The app's source files.

See the visual app designer.

Types

EntitySchema, EntityField, DashboardSpec (from @svgrid/enterprise); ServerDataSource, ServerRequest, ServerState, ColumnDef (from @svgrid/grid). The EntitySchema reference documents the field options in full.

See also