GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - vanakat/plugin-api: Standartized way to expose and use Obsidian Inter-Plugin APIs

BranchesTags
Open more actions menu

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.eslintrc
.eslintrc
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.ts
index.ts
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Obsidian Plugin API

Standardized way of exposing and using Obsidian plugin APIs.

APIs are published on the global window.PluginApi object, so they can be used by other plugins as well as anywhere else in Obsidian, e.g. in Templater user scripts or the developer console.

Installation

npm install --save-dev @vanakat/plugin-api

Usage

This module exposes 2 functions:

  • registerAPI(name, api, plugin) – registers plugin API in global variable (window.PluginApi); the API is automatically unregistered when the plugin unloads
  • pluginApi(name) – returns plugin API based on its name; if no API is registered under that name, shows a notice asking the user to install the plugin

Exposing an API from your plugin:

import { Plugin } from 'obsidian';
import { registerAPI } from '@vanakat/plugin-api';

export class MyPlugin extends Plugin {
    async onload() {
        registerAPI('MyPlugin', new MyPluginApi(this), this);
    }
}

Consuming an API from another plugin:

import { pluginApi } from '@vanakat/plugin-api';

const api = pluginApi('MyPlugin');

Examples

Following plugins already use @vanakat/plugin-api:

  • Zotero Bridge as an API provider
  • Zotero Link as an API consumer

License

MIT

About

Standartized way to expose and use Obsidian Inter-Plugin APIs

Resources

Readme
MIT license
Activity
Custom properties

Stars

11 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.