Wiki home
Developer guide

Build an Amazify plugin

A plugin is a small directory with a manifest plus optional JavaScript, CSS, images, SVGs, fonts, and JSON. Keep ownership visible, permissions narrow, and cleanup complete.

Minimal structure

example.my-plugin/
  manifest.json
  plugin.js
  style.css
  assets/
    logo.svg

Manifest

{
  "id": "example.my-plugin",
  "name": "My Plugin",
  "version": "0.1.0",
  "author": "Your Name",
  "type": "ui",
  "description": "A short user-facing description.",
  "entry": "plugin.js",
  "styles": ["style.css"],
  "assets": { "logo": "assets/logo.svg" },
  "permissions": ["dom-read", "dom-write", "dom-style"],
  "amazonMusic": {
    "testedAppVersions": [],
    "target": "desktop"
  }
}

Use a stable reverse-domain-style ID, semantic versioning, a concise description, and only the permissions the implementation requires.

Runtime entry point

Plugin JavaScript receives Amazify, manifest, and source. Return a cleanup function that removes listeners, observers, timers, DOM, and any state your plugin added.

const badge = document.createElement("div");
badge.dataset.amazifyPluginId = manifest.id;
badge.textContent = "Active";
document.body.appendChild(badge);

return function cleanup() {
  badge.remove();
};

DOM ownership

Mark plugin-owned elements with data-amazify-plugin-id. Scope CSS under a plugin-specific class or attribute. Amazon Music can rerender sections at any time, so observers should be narrow, debounced where practical, and disconnected during cleanup.

Assets

Declare assets in the manifest and resolve them through Amazify.assets.url(manifest.id, "logo") or source.assetUrl("logo"). Matching CSS url(...) references are rewritten to validated data URLs at runtime.

Permissions

  • dom-read discloses that the plugin reads the Amazon Music document.
  • dom-write discloses that it changes document structure or behavior.
  • dom-style discloses injected or modified styles.
  • network discloses external requests and should be avoided unless essential.
Important: permissions are disclosure and consent signals, not a complete JavaScript sandbox. Enabled plugins run in the signed-in Amazon Music renderer and can affect what the user sees and does.

Before publishing

  • Test enable, disable, reinstall, and update paths.
  • Verify cleanup while the affected Amazon Music view is open.
  • Test narrow and wide windows, plus Amazon Music rerenders and track changes.
  • Pin the source revision and list every file accurately for catalog review.
  • Document external endpoints and failure behavior for any network permission.

Read the stock plugin source