Plugins
Unofficial
Manager for community plugins, handling installation, enabling, and lifecycle.
Import:
import type { Plugins } from '@obsidian-typings/obsidian-public-latest';Signature:
export interface Plugins extends EventsExtends: Events
Constructor
new Plugins(app: App)Constructor.
To get the constructor instance, use getPluginsConstructor from obsidian-typings/implementations.
Properties
| Property | Type | Description | |
|---|---|---|---|
| _ | Record<string, EventsEntry[]> | Internal storage of registered event handlers by event name. (Inherited from Events) | |
| app | App | Reference to the obsidian#App. | |
| autoCheckForUpdates | boolean | Whether automatic update checking is enabled. | |
| enabledPlugins | Set<string> | Set of enabled plugin IDs. | |
| lastUpdateCheck | number | Timestamp of the last update check. | |
| loadingPluginId | null | string | obsidian#Plugin ID that is currently being enabled. | |
| manifests | PluginsManifestsRecord | Manifests of all the plugins that are installed. | |
| plugins | PluginsPluginsRecord | Mapping of plugin ID to active plugin instance. | |
| requestSaveConfig | Debouncer<[], Promise<void>> | Debounced function to save the plugin configuration. | |
| updates | Map<string, PluginUpdateManifest> | Mapping of plugin ID to available updates. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| checkForDeprecations() | Promise<void> | Check online list for deprecated plugins to automatically disable. | |
| checkForUpdates(showNotice?) | Promise<void> | Check for plugin updates. | |
| disablePlugin(id) | Promise<void> | Unload a plugin by ID. | |
| disablePluginAndSave(id) | Promise<void> | Unload a plugin by ID and save config for persistence. | |
| enablePlugin(id) | Promise<void> | Enable a plugin by ID. | |
| enablePluginAndSave(id) | Promise<void> | Enable a plugin by ID and save config for persistence. | |
| getPlugin(id) | null | Plugin | Get a plugin by ID. | |
| getPluginFolder() | string | Get the folder where plugins are stored. | |
| initialize() | Promise<void> | Load plugin manifests and enable plugins from config. | |
| installPlugin(repo, version, manifest) | Promise<void> | Install a plugin from a given URL. | |
| isDeprecated(id) | boolean | Check whether a plugin is deprecated. | |
| isEnabled() | boolean | Check whether community plugins are enabled. | |
| loadManifest(path) | Promise<void> | Load a specific plugin's manifest by its folder path. | |
| loadManifests() | Promise<void> | Load all plugin manifests from plugin folder. | |
| loadPlugin(id, isUserEnabled?) | Promise<Plugin> | Load a plugin by its ID. | |
| off(name, callback) | void | Remove an event listener. (Inherited from Events) | |
| offref(ref) | void | Remove an event listener by reference. (Inherited from Events) | |
| on(name, callback, ctx?) | EventRef | Add an event listener. (Inherited from Events) | |
| onRaw(e) | void | Handle raw file system change events for plugin config files. | |
| saveConfig() | Promise<void> | Save current plugin configs. | |
| setAutomaticUpdateCheck(enabled) | void | Set whether automatic update checking is enabled. | |
| setEnable(enabled) | Promise<void> | Toggle whether community plugins are enabled. | |
| trigger(name, data?) | void | Trigger an event, executing all the listeners in order even if some of them throw an error. (Inherited from Events) | |
| tryTrigger(evt, args) | void | Try to trigger an event, executing all the listeners in order even if some of them throw an error. (Inherited from Events) | |
| uninstallPlugin(id) | Promise<void> | Uninstall a plugin by ID. | |
| unloadPlugin(id, isUserDisabled?) | Promise<void> | Unload a plugin by ID. |
Links to this page: