{"id":13562560,"url":"https://github.com/obsidianmd/obsidian-api","last_synced_at":"2025-04-09T03:10:30.084Z","repository":{"id":38685838,"uuid":"307408387","full_name":"obsidianmd/obsidian-api","owner":"obsidianmd","description":"Type definitions for the latest Obsidian API.","archived":false,"fork":false,"pushed_at":"2024-09-19T18:29:12.000Z","size":197,"stargazers_count":1725,"open_issues_count":19,"forks_count":200,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-10-29T15:24:17.845Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.obsidian.md","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obsidianmd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-26T14:56:48.000Z","updated_at":"2024-10-29T00:27:01.000Z","dependencies_parsed_at":"2022-07-14T09:22:19.228Z","dependency_job_id":"873d73c9-2ba9-46f1-9af8-719c48d691f7","html_url":"https://github.com/obsidianmd/obsidian-api","commit_stats":{"total_commits":139,"total_committers":10,"mean_commits":13.9,"dds":0.2517985611510791,"last_synced_commit":"23947b58d372ea02225324308e31d36b4aa95869"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsidianmd%2Fobsidian-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsidianmd%2Fobsidian-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsidianmd%2Fobsidian-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsidianmd%2Fobsidian-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obsidianmd","download_url":"https://codeload.github.com/obsidianmd/obsidian-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247968368,"owners_count":21025823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:01:09.927Z","updated_at":"2025-04-09T03:10:30.063Z","avatar_url":"https://github.com/obsidianmd.png","language":null,"readme":"## Obsidian API\r\n\r\nType definitions for the latest [Obsidian](https://obsidian.md) API.\r\n\r\n### Documentation\r\n\r\nYou can browse our Plugin API documentation at https://docs.obsidian.md/\r\n\r\nFor an example on how to create Obsidian plugins, use the template at https://github.com/obsidianmd/obsidian-sample-plugin\r\n\r\n### Issues and API requests\r\n\r\nFor issues with the API, or to make requests for new APIs, please go to our forum: https://forum.obsidian.md/c/developers-api/14\r\n\r\n### Plugin structure\r\n\r\n`manifest.json`\r\n\r\n- `id` the ID of your plugin.\r\n- `name` the display name of your plugin.\r\n- `author` the plugin author's name.\r\n- `version` the version of your plugin.\r\n- `minAppVersion` the minimum required Obsidian version for your plugin.\r\n- `description` the long description of your plugin.\r\n- `isDesktopOnly` whether your plugin uses NodeJS or Electron APIs.\r\n- `authorUrl` (optional) a URL to your own website.\r\n- `fundingUrl` (optional) a link for users to donation to show appreciation and support plugin development.\r\n\r\n`main.js`\r\n\r\n- This is the main entry point of your plugin.\r\n- Import any Obsidian API using `require('obsidian')`\r\n- Import NodeJS or Electron API using `require('fs')` or `require('electron')`\r\n- Must export a default class which extends `Plugin`\r\n- Must bundle all external dependencies into this file, using Rollup, Webpack, or another javascript bundler.\r\n\r\n### App Architecture\r\n\r\n##### The app is organized into a few major modules:\r\n\r\n- `App`, the global object that owns everything else. You can access this via `this.app` inside your plugin. The `App` interface provides accessors for the following interfaces.\r\n- `Vault`, the interface that lets you interact with files and folders in the vault.\r\n- `Workspace`, the interface that lets you interact with panes on the screen.\r\n- `MetadataCache`, the interface that contains cached metadata about each markdown file, including headings, links, embeds, tags, and blocks.\r\n\r\n##### Additionally, by inheriting `Plugin`, you can:\r\n- Add a ribbon icon using `this.addRibbonIcon`.\r\n- Add a status bar (bottom) element using `this.addStatusBarItem`.\r\n- Add a global command, optionally with a default hotkey, using `this.addCommand`.\r\n- Add a plugin settings tab using `this.addSettingTab`.\r\n- Register a new kind of view using `this.registerView`.\r\n- Save and load plugin data using `this.loadData` and `this.saveData`.\r\n\r\n##### Registering events\r\n\r\nFor registering events from any event interfaces, such as `App` and `Workspace`, please use `this.registerEvent`, which will automatically detach your event handler when your plugin unloads:\r\n```\r\nthis.registerEvent(app.on('event-name', callback));\r\n```\r\n\r\nIf you register DOM events for elements that persist on the page after your plugin unloads, such as `window` or `document` events, please use `this.registerDomEvent`:\r\n```\r\nthis.registerDomEvent(element, 'click', callback);\r\n```\r\n\r\nIf you use `setInterval`, please use `this.registerInterval`:\r\n```\r\nthis.registerInterval(setInterval(callback, 1000));\r\n```\r\n","funding_links":[],"categories":["Others","miscellaneous","Creating Plugins","🙏 Acknowledgments","⚙️ Backend \u0026 APIs","Obsidian Vault Architecture for Agents"],"sub_categories":["Planned Features","Benchmark Reality Check (real-world tool use)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobsidianmd%2Fobsidian-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobsidianmd%2Fobsidian-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobsidianmd%2Fobsidian-api/lists"}