Skip to content

getInstalledPluginVersion

Reads the version of another plugin as this vault has it installed, or null when it is not running.

The version comes out of app.plugins.manifests, which is populated for every installed plugin at startup — so, unlike anything a plugin REGISTERS, it answers the same way no matter which plugin loaded first. That load-order independence is the whole reason a conflict is detected by version rather than by asking a registry.

null for a plugin that is not installed OR is installed but disabled: a disabled plugin registers nothing, so for every question this answers the two cases are the same. An installed, enabled plugin whose manifest somehow carries no version reads as an empty string rather than null, which keeps “running, version unknown” distinguishable from “not running” — a caller comparing versions should fail closed on it rather than treat it as absent.

Import:

import { getInstalledPluginVersion } from 'obsidian-dev-utils/obsidian/plugin/plugin-install-state';

Signature:

function getInstalledPluginVersion(params: GetInstalledPluginVersionParams): string | null

Parameters:

ParameterTypeDescription
paramsGetInstalledPluginVersionParamsThe GetInstalledPluginVersionParams.

Returns: string | null — The installed version, or null when the plugin is not enabled.


Links to this page: