Skip to content

obsidian/desktop-demo-vault-opener

Downloads and opens a plugin’s shipped demo vault in a new Obsidian window (desktop only).

A plugin can attach a <plugin-id>-demo-vault-<version>.zip archive to each GitHub release (see archivePluginDemoVault in script-utils/demo-vault.ts). This resolves the plugin’s repository from Obsidian’s community registry, downloads the archive for the chosen version, and opens it as a vault in a new window. When the installed plugin version is behind the latest release, the user is offered a choice between the two versions.

A progress notice is shown immediately (download + extraction can take a while, so the user must see something is happening right away). Only the downloaded ARCHIVE is cached (under the OS temp directory); every invocation extracts a FRESH copy into its own temporary folder and opens that, so a previous session’s edits never leak into a new one. The extracted vault folder is named <plugin-id>-<version>.demo-vault so it reads nicely in Obsidian’s vault switcher. Orphaned extracted folders left over from earlier sessions are cleaned up (best-effort) on each open.

InterfaceDescription
OpenDemoVaultParamsParameters for openDemoVault.
FunctionDescription
openDemoVaultDownloads and opens the plugin’s demo vault in a new Obsidian window. Desktop only. If the installed plugin version is the latest (or newer), its demo vault opens directly; otherwise the user chooses between the latest and the currently-installed version. A progress notice is shown immediately. The chosen version’s archive is downloaded once (then reused from the archive cache), but a fresh copy is extracted into its own temporary folder on every open — the vault is never reused across sessions.