Skip to content

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 Events

Extends: Events

Constructor

new Plugins(app: App)

Constructor.

To get the constructor instance, use getPluginsConstructor from obsidian-typings/implementations.

Properties

PropertyTypeDescription
_Record<string, EventsEntry[]>Internal storage of registered event handlers by event name.
(Inherited from Events)
appAppReference to the obsidian#App.
autoCheckForUpdatesbooleanWhether automatic update checking is enabled.
didChangeDebouncer<[], void>Debounced callback that fires a changed event when the plugin set changes.
enabledPluginsSet<string>Set of enabled plugin IDs.
lastUpdateChecknumberTimestamp of the last update check.
loadingPluginIdnull | stringobsidian#Plugin ID that is currently being enabled.
manifestsPluginsManifestsRecordManifests of all the plugins that are installed.
pluginsPluginsPluginsRecordMapping of plugin ID to active plugin instance.
requestSaveConfigDebouncer<[], Promise<void>>Debounced function to save the plugin configuration.
updatesMap<string, PluginUpdateManifest>Mapping of plugin ID to available updates.

Methods

MethodReturnsDescription
checkForDeprecations()Promise<void>Check online list for deprecated plugins to automatically disable.
checkForUpdates(showNotice?)Promise<void>Check for plugin updates.
clearEnabledPlugins()Promise<void>Clears the set of enabled plugins and persists the change.
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 | PluginGet a plugin by ID.
getPluginFolder()stringGet 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)booleanCheck whether a plugin is deprecated.
isEnabled()booleanCheck 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)voidRemove an event listener.
(Inherited from Events)
offref(ref)voidRemove an event listener by reference.
(Inherited from Events)
on(name, callback, ctx?)EventRefAdd an event listener.
(Inherited from Events)
onRaw(e)voidHandle raw file system change events for plugin config files.
saveConfig()Promise<void>Save current plugin configs.
setAutomaticUpdateCheck(enabled)voidSet whether automatic update checking is enabled.
setEnable(enabled)Promise<void>Toggle whether community plugins are enabled.
trigger(name, data?)voidTrigger an event, executing all the listeners in order even if some of them throw an error.
(Inherited from Events)
tryTrigger(evt, args)voidTry 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: