This page documents the legacy settings API, which is deprecated. It keeps working for existing
apps, but new apps should define settings in
src/app/settings/ instead; see Workspace
settings. To convert an existing app, use the folder structure migration
guide.setWorkspaceSetting() function updates a single workspace setting value programmatically.
Parameters
string
required
The key of the setting to update. Must match a key defined in your workspace settings schema.The key is fully typed, so TypeScript will only allow valid setting keys.
string | boolean | number
required
The new value for the setting. The type must match the setting type defined in your schema.TypeScript will enforce that the value type matches the setting type.
Returns
A promise that resolves when the setting has been updated.Example
toggle-auto-sync.server.ts
In Client Code
record-action.tsx
Type Safety
The function enforces type safety for both keys and values:app.settings.ts