Skip to content

Extension API V1

appdevelpo edited this page Apr 14, 2026 · 1 revision

Miru Extension API V1 (Legacy)

Miru API V1 uses a class-based inheritance approach. This version is maintained for backward compatibility but V2 is recommended for new extensions.

Core Interface

To implement a V1 extension, you must define a class that extends the base Extension class.

class MyExtension extends Extension {
    async load() { 
        // Initialization
    }
    
    async latest(page) {
        // Return latest items
    }
    
    async search(kw, page, filter) {
        // Search items
    }
    
    async createFilter(filter) {
        // Define filters
    }
    
    async detail(url) {
        // Get details and episodes
    }
    
    async watch(url) {
        // Get playable content
    }
}

Differences from V2

  • Class-Based: Methods must be defined on a class.
  • Context: Access metadata via this.webSite, this.name, etc.
  • Settings: Register via this.registerSetting() and retrieve via await this.getSetting().

Networking & Utilities

Same as V2, you can use fetch() or the legacy Miru.request(). Built-in modules like linkedom and crypto-js are available via require().

Clone this wiki locally