settings.json API works in conjunction with
settings.js to deliver a customizable experience to the user.
The settings.json file can be in JSON format as well as JSON5. JSON5 is a newer implementation of JSON that allows comments, trailing commas, and some other great things.
settings.json Skeleton File
Want to see a full example?You can download a fully working Module Package from our examples repo on GitHub.
settings.json API. Only the settings that are included in this file are passed to the
settings.json has a single acceptable top-level field called
fields, which is an array of objects that controls the acceptable inputs for each related setting.
These are the allowed fields of a
name<string> The name of the settings field
default<?any> The default value of the field
truethe user will not be able to save the settings until this field has a value
type<?string> Specify the type of the setting (
min<?number> Minimum value for a number field or the minimum length of a string field
max<?number> Maximum value for a number field or the maximum length of a string field
The only required field is
type is not required, it is useful to set as it will automatically convert the user's settings to match the
type. For example, if the
number but a
string is provided, the
string will be converted to a
number prior to being saved.
type does not refer to the setting's related HTML tag. The HTML tag can be anything including