Skip to main content
Apps may configure settings which let users customize the app at the workspace level. Settings live in src/app/settings/ and consist of a schema defined with Settings.defineWorkspaceSchema and a page defined with Settings.defineWorkspacePage, displayed with form components from Settings.useForm. Unlike regular forms in dialogs, workspace settings forms automatically save changes and don’t require a submit button or onSubmit handler. Each field saves individually:
  • Text inputs and number inputs save onBlur (when the user leaves the field)
  • Toggles, checkboxes, and comboboxes save onChange (immediately when changed)
Only workspace admins can edit workspace settings. However, all workspace members can view the settings.

Example: Basic workspace settings

First, define your settings schema as the default export of src/app/settings/schema.ts:
src/app/settings/schema.ts
Then, define your workspace settings page as the default export of src/app/settings/page.tsx:
src/app/settings/page.tsx
The process to create workspace settings is:
  1. Define a schema with Settings.defineWorkspaceSchema at src/app/settings/schema.ts
  2. Define a page with Settings.defineWorkspacePage at src/app/settings/page.tsx
  3. Use Settings.useForm inside the page’s render callback to get form components
  4. Wrap your settings inputs in the <Form/> and organize with <Section/> components

Validation

Unlike regular forms where validation is defined in the schema, workspace settings validation is specified directly on the input components:
src/app/settings/page.tsx

Available components

Workspace settings forms support the following components:

Input components

Layout components

Utility components

  • <Button /> - Action buttons for additional functionality
  • <WithState /> - Access form state for conditional rendering

Accessing settings in your app

Once your workspace settings are configured, you can access them in different ways. Every setting value is null until it has been set.

With real-time updates

In React components, use the Settings.useSettings hook to get settings that automatically update when changed:
src/app/extensions/team-widget/team-widget-content.tsx

Programmatically

Use Settings.getSettings and Settings.setSettings to read and write settings. They’re available from both attio/client (for use in extensions, dialogs, etc.) and attio/server (for use in server functions, webhook handlers, and event handlers): In client code:
src/app/extensions/sync-record/extension.tsx
In server functions:
src/sync-data.server.ts