You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Utilities for working with Obsidian's undocumented API in a version-agnostic manner.
Installation
Use npm or yarn to install type definitions for undocumented Obsidian APIs:
npm install obsidian-extra
Usage
Import the desired function(s) and use them!
import{getEnabledPluginIDs,getPluginInstance}from"obsidian-extra";// Inside your Plugin class:constenabledPluginInstances=getEnabledPluginIDs(this.app).map((id)=>getPluginInstance(this.app,id));
Certain functions are deemed "unsafe", as they have the ability to easily break Obsidian or interfere with the operation of other plugins. These functions are only available in the obsidian-extra/unsafe import.
Design Goals
Tree-shakeable.
Using functions from obsidian-extra should only bring in exactly what they need.
Safety first.
Functions should not have the ability to break Obsidian just by themselves, unless exported through the "unsafe" import.
Simple abstraction.
No complicated classes and designs. A function does exactly what you need, only abstracting away the parts that could be accidentally misused.