Bootstrap & Schema
getBootstrap(signal?)
Returns context about the current user, their role, the app, and plan limits. Call this once during initialisation and cache the result — it does not change mid-session. Store the result in a module-level variable rather than calling getBootstrap() on every user action.
1const bootstrap = await sdk.getBootstrap();23// bootstrap.user — { id, name, email }4// bootstrap.role — 'viewer' | 'editor' | 'admin'5// bootstrap.app — { id, name, type }6// bootstrap.limits — { maxPageSize, maxRecordCount, rateLimitPerMinute }
Role
Use bootstrap.role to conditionally show or hide editing controls:
1const canEdit = ['editor', 'admin'].includes(bootstrap.role);2const isAdmin = bootstrap.role === 'admin';
See Roles & Permissions for the full role capability matrix, and the Role-Based UI guide for patterns.
User
Use bootstrap.user to personalise the UI or pre-fill the current user's details:
1document.getElementById('welcome').textContent = `Hello, ${bootstrap.user.name}`;
Limits
bootstrap.limits is a key-value map of plan limits for the authenticated user:
| Key | Description |
|---|---|
maxPageSize |
Maximum allowed pageSize for listRecords |
maxRecordCount |
Maximum records allowed per app on this plan |
rateLimitPerMinute |
API requests allowed per minute |
1const { maxRecordCount } = bootstrap.limits;2if (currentCount >= maxRecordCount) {3 showMessage('Record limit reached. Contact your admin to upgrade.');4}
Allowed during maintenance
getBootstrap() is a read operation and is allowed during maintenance mode.
getSchema(signal?)
Returns the entity schema for the current app — all entities and their fields. Use this for dynamic form rendering or runtime field discovery.
1const schema = await sdk.getSchema();2// schema.data — SchemaEntity[]
SchemaEntity
1{2 key: string, // e.g. 'tasks'3 name: string, // e.g. 'Tasks'4 display_field: string | null, // the field shown in lists and linked records5 fields: SchemaField[],6}
SchemaField
1{2 key: string, // e.g. 'status'3 name: string, // e.g. 'Status'4 type: string, // e.g. 'select' — see Field Types reference5 required: boolean,6 read_only: boolean,7 options: string[] | null, // only set for select / multi_select fields8 sort_order: number,9}
Example — dynamic form rendering
1const schema = await sdk.getSchema();2const tasksEntity = schema.data.find(e => e.key === 'tasks');34tasksEntity.fields.forEach(field => {5 if (field.type === 'select') {6 renderSelectField(field.key, field.name, field.options, field.required);7 } else if (field.type === 'text') {8 renderTextField(field.key, field.name, field.required);9 }10 // etc.11});
See Field Types for all field type strings and their stored formats.
Allowed during maintenance
getSchema() is a read operation and is allowed during maintenance mode.