Skip to content

Utilities for working with Obsidian's undocumented API in a version-agnostic manner.

License

Notifications You must be signed in to change notification settings

eth-p/obsidian-extra

Repository files navigation

obsidian-extra

support Obsidian versions total downloads

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:
const enabledPluginInstances = 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.

Features

Workspace

Plugins

Settings

CSS

Custom CSS

View Registry

Platform

About

Utilities for working with Obsidian's undocumented API in a version-agnostic manner.

Resources

License

Stars

Watchers

Forks

Packages

No packages published