Overview
TheApp class is the central interface for interacting with Obsidian. It provides access to all major subsystems including the workspace, vault, metadata cache, and more. Every plugin receives an instance of App which serves as the entry point for most plugin functionality.
Available since: v0.9.7
Properties
The keymap manager for handling keyboard shortcuts.Since: v0.9.7
The current scope for managing keybindings and event handlers.Since: v0.9.7
The workspace manager providing access to leaves, panes, and the active view.Since: v0.9.7
The vault interface for reading, writing, and managing files.Since: v0.9.7
The metadata cache containing parsed file information, links, and frontmatter.Since: v0.9.7
The file manager for higher-level file operations like renaming and moving files.Since: v0.11.0
The last known user interaction event, useful for determining which modifier keys are currently pressed.Since: v0.12.17
The render context for managing rendering operations.Since: v1.10.0
Secure storage for sensitive data like API keys and tokens.Since: v1.11.4
Methods
isDarkMode()
Determines whether the app is currently in dark mode. Returns:boolean - true if dark mode is enabled, false otherwise.
Since: v1.10.0
loadLocalStorage()
Retrieves a value fromlocalStorage specific to the current vault.
The key to retrieve from localStorage.
any | null - The stored value, or null if not found.
Since: v1.8.7
saveLocalStorage()
Saves a vault-specific value tolocalStorage. If data is null, the entry will be cleared.
The key under which to store the data.
The value to store. Must be serializable. Pass
null to clear the entry.void
Since: v1.8.7
Example
Related Types
UserEvent- Type alias forMouseEvent | KeyboardEvent | TouchEvent | PointerEventWorkspace- Interface for managing workspace layout and viewsVault- Interface for file system operationsMetadataCache- Interface for accessing parsed file metadataFileManager- Interface for high-level file operations