Settings.setSettings() updates a single workspace setting value programmatically. Pass null to clear a value.
It is available from both attio/client and attio/server:
Parameters
WorkspaceSettingsSchema
required
The schema built with
Settings.defineWorkspaceSchema, imported
from your schema file.string
required
The key of the setting to update. Must match a key defined in your schema; the key is fully
typed, so TypeScript will only allow valid setting keys.
string | number | boolean | null
required
The new value for the setting. The type must match the setting type defined in your schema;
TypeScript will enforce this. Pass
null to clear the setting.Returns
A promise that resolves when the setting has been updated.Example
src/toggle-auto-sync.server.ts
Type safety
The function enforces type safety for both keys and values:Related
Settings.getSettings()- Read setting valuesSettings.useSettings()- Read settings reactively in React components