Options
All
  • Public
  • Public/Protected
  • All
Menu

joplin.settings

This API allows registering new settings and setting sections, as well as getting and setting settings. Once a setting has been registered it will appear in the config screen and be editable by the user.

Settings are essentially key/value pairs.

Note: Currently this API does not provide access to Joplin's built-in settings. This is by design as plugins that modify user settings could give unexpected results

View the demo plugin

Index

Methods

globalValue

  • globalValue(key: string): Promise<any>

onChange

  • Called when one or multiple settings of your plugin have been changed.

    • For performance reasons, this event is triggered with a delay.
    • You will only get events for your own plugin settings.

    Parameters

registerSection

  • registerSection(name: string, section: SettingSection): Promise<void>
  • Registers a new setting section. Like for registerSetting, it is dynamic and needs to be done every time the plugin starts.

    Parameters

registerSetting

  • registerSetting(key: string, settingItem: SettingItem): Promise<void>
  • deprecated

    Use joplin.settings.registerSettings()

    Registers a new setting.

    Parameters

registerSettings

  • registerSettings(settings: Record<string, SettingItem>): Promise<void>
  • Registers new settings. Note that registering a setting item is dynamic and will be gone next time Joplin starts. What it means is that you need to register the setting every time the plugin starts (for example in the onStart event). The setting value however will be preserved from one launch to the next so there is no risk that it will be lost even if for some reason the plugin fails to start at some point.

    Parameters

setValue

  • setValue(key: string, value: any): Promise<void>
  • Sets a setting value (only applies to setting you registered from your plugin)

    Parameters

    • key: string
    • value: any

value

  • value(key: string): Promise<any>
  • deprecated

    Use joplin.settings.values()

    Gets a setting value (only applies to setting you registered from your plugin)

    Parameters

    • key: string

values

  • values(keys: string[] | string): Promise<Record<string, unknown>>
  • Gets setting values (only applies to setting you registered from your plugin)

    Parameters

    • keys: string[] | string