F

define

Binds a settings schema to a Bucket: reads apply defaults and writes are validated against the schema. Plugins reach it through @unbound-app/settings, which the build generates from their settings.ts.

function define(schema: SettingsSchema, name?: string): DefinedSettings

Parameters

NameTypeDescription
schemaSettingsSchema

The settings schema.

name?string

The Bucket name. A plugin may omit it to use its own Bucket.

Returns

DefinedSettings

The settings, their hook and their reset.

Throws

When name is omitted outside a plugin.