ContentsCapabilities
  1. API

    1. Using the API
    2. API reference
    3. Emby-compatible API
  2. Plugin SDK

    1. Plugins and built-in features
    2. Capabilities
    3. Quick start
    4. Package, sign and publish

Capabilities

A plugin lists the capabilities it provides in its manifest. The server only calls a plugin for what it declares; a call to an undeclared capability is not forwarded. The admin console sorts plugins into categories from their capabilities, so a plugin does not pick its own category.

On this page
  1. Conventions
  2. Errors
  3. Tasks
  4. Checks
  5. Settings fields
  6. Settings per library
  7. Discover
  8. Page actions, subscriptions and the calendar
  9. Network access
  10. Permissions
  11. Host features
Capability What it means
metadata.movie Search for and fetch movie metadata
metadata.series Series, seasons and episodes
metadata.person Person details
metadata.person.search Find a person from a name and the titles they appear in, when no provider ID is known
metadata.collection Collection details
metadata.trailers Return trailers with the item
metadata.search.hints Receive the recognition hints (titles, year, language, shape) in a search
metadata.series.absolute Accept an absolute episode number
images.movie, images.series Posters, backdrops and logos by provider ID
images.person Person photos, by provider ID, name and aliases
subtitles.search Search and download subtitles
media.recognize Work out a title from a path or file name, without reading the file or using the network
segments.provider, segments.submit Community intro and outro data: read and contribute
danmaku.provider Bullet comments (danmaku) for a video
usersync.link, usersync.scrobble, usersync.watched.pull, usersync.watched.push Link an account and sync watch state with an outside service
people.aliasmap A map of alternative names for people
cast.target Find devices on the local network and play on them. Needs the network.lan permission and a declared cast protocol
discover.source, work.action Show members works that are not in the library, and act on them through an external tool (see Discover below). Both are free on every plan
page.action, discover.subscriptions, discover.calendar Actions on a plugin's own Discover pages, a member's subscriptions with a form for new ones, and a calendar of dates (see Discover below). Each is independent and free on every plan
network.access, network.identity Join the server to another network and, optionally, tell the host who is connecting and who is still there (see Network access below). Free on every plan
plugin.tasks Maintenance tasks the plugin lists in its manifest, run on a schedule or on demand (see Tasks below)
plugin.checks Buttons on the settings page that test the settings, such as an API key (see Checks below)

A search result can carry confirmed when the plugin is certain it is the item, for example an exact code read from the file name. A host that declares the host feature search_confirmed applies a single confirmed candidate automatically, whatever its score; several confirmed candidates are treated as ambiguous. Send an honest score as well, because hosts without the feature ignore confirmed. Only set it when the match is exact, never for a fuzzy one.

When a library has name recognition, the search and item requests carry its result (recognition: part, tags, flags, edition, hints, evidence and identifiers the server does not know) under the host feature recognition_hint. A provider ID found there is written into the item's provider IDs, but never over one set by hand or read from an NFO file. A recognizer can also set numbering_confirmed (host feature confirmed_numbering) so that its season and episode numbers replace the server's own parse. From server 0.9.10 the server applies no score threshold of its own: a result is applied automatically when it shares a provider ID with the item, when exactly one candidate is confirmed, or when exactly one candidate has the same title and year. The score only orders the candidates and is shown in the identify dialog, so send an honest one.

Subtitle search results can carry confirmed too (host feature subtitle_confirmed, server 0.9.10 and later). Automatic subtitle download takes only a candidate matched by file hash or by IDs, or one the plugin has confirmed, in the plugin's order and without a score threshold; which subtitle fits a video is the plugin's decision. The manual search list still shows every candidate. Confirm only when you are sure, for example when title, year and running time all match.

Search and item requests of metadata plugins also carry file_paths, the item's files as paths relative to the library folder, main version first (host feature file_paths, server 0.9.10 and later). A plugin can read markers the user put in folder and file names, for example a product code or an edition suffix. They are never absolute server paths.

Bullet comments (danmaku) and subtitle requests carry the item's original title (for an episode, the series') and its product code, when it has them (host feature lookup_names), next to the current title, year, provider IDs, season and episode. A source that knows a work by another name or by code can use them; which to use is the plugin's choice.

Name recognition, subtitle search and download and community segments are paid capabilities (bullet comments are free): the server does not use them without the matching plan, whoever provides them. The plugin itself still installs and runs.

Conventions#

  • Requests carry a language (BCP 47) and fallback languages. Return text in the requested language when you can.
  • Provider ID keys are lowercase (tmdb, imdb, tvdb). Dates are YYYY-MM-DD.
  • Image addresses should be HTTPS; plain HTTP is accepted. The server downloads and caches the images; a plugin writes no image files. Images on a private network address (for example a NAS) need the host listed in the manifest's image fetch rules and the network.lan permission, which the administrator must turn on for the plugin. Addresses on your network must be an IP address or a name registered on the router; .local names are not resolved.
  • A plugin can tell the user what happened at each source (sign-in needed, blocked, timed out) with notices, and can mark a slow result as incomplete so the server asks again later. A plugin that combines several sources can name the source of each field and image (SearchCandidate.source); the server shows it with the candidate.
  • Item stills (scene images) have their own image type. A person's gallery photos have another.
  • Searching with no results returns an empty list, not an error.

Errors#

Return a standard gRPC code, and the server reacts to it:

Code Use it for What the server does
NOT_FOUND The item does not exist Treats it as no result
INVALID_ARGUMENT A bad request Reports it
FAILED_PRECONDITION The plugin needs configuration Takes it out of use until Configure passes
RESOURCE_EXHAUSTED The service rate-limits you; add a retry-after-seconds trailer Pauses calls to the plugin (default 60 seconds, at most one hour)
UNAUTHENTICATED The member's credential is no longer valid Asks the member to link again
UNAVAILABLE, deadline errors Temporary trouble Retries later

Tasks#

A plugin that declares plugin.tasks lists maintenance tasks in its manifest, for example refreshing a downloaded index or clearing a cache. Each has a name (never renamed after release), a title, a description and an optional default schedule: every 5 to 44640 minutes, or a five-field cron expression in the server's time zone. They show in the task center and under Scheduled tasks on the plugin's page, where administrators can change the schedule, pause it or press Run now. A task runs only when its schedule is due or an administrator starts it, never because the plugin was enabled, configured or restarted. A run may last up to 30 minutes, and the same task never runs twice at once. Tasks are free on every plan. Do not use a task for work the server already schedules for a capability, such as scraping.

Checks#

A plugin that declares plugin.checks lists up to 16 checks, such as "test the API key" or "show the remaining quota". Each is a button on the plugin's settings page. A check runs only when an administrator presses it, with the settings as currently filled in, even if they are not saved. It returns lines marked OK, warning or failed. The server only shows them: it stores nothing and a result never decides whether settings can be saved. A check has a 30-second limit, only one check of a plugin runs at a time, and the same check cannot run again within 10 seconds. A check must not download data in bulk, write files or start other work. In a group of similar entries a check can belong to one entry, shown inside it as "Test this source", and the server can also run it for every entry in turn.

Settings fields#

A manifest lists the fields of the settings form. Each has a key (lowercase letters, digits and underscores, never renamed after release), a label, an optional description, a link with a label (HTTPS, for example where to get an API key), and a type:

Type Stored as
string The text as typed
secret Stored encrypted by the server. The console only shows whether it is set and never shows the value; give it no default
bool "true" or "false"
int A decimal number, with optional min and max
select The value of one option
multiselect A JSON array of option values, for example ["en","ja"]
text A multi-line text box, at most 64 KiB
string_list A JSON array of strings; the user adds, removes and reorders entries
ordered_multiselect A JSON array of the chosen option values, highest priority first

Fields can be grouped. A group can be collapsed by default as advanced, carry an icon, or be a list of similar entries (for example one per data source) with the same settings, which the console shows as a searchable list. A field can be shown only while another field has certain values. The limits are 1000 fields, 50 groups, 200 options per field and 100 entries per group. A required field without a value shows the plugin as needing configuration. Configure receives the complete saved settings; answer with an error and per-field errors to reject them, and keep the previous settings when you do. Translations are optional: an English-only plugin is complete, and other languages fall back to English.

Settings per library#

Mark the settings that make sense for a single library with library_override (for example a recognition profile or how many cast members to fetch); at most 32 per plugin, never on secret or required fields. The library's settings page then offers each one with "Use the plugin setting" as the default, and the plugin finds the library's own values in LibraryContext.overrides on search, item, image, recognition and subtitle search requests. People, tasks, checks, segments, bullet comments and account sync are not per library. Rules to follow:

  • Use the values only for that request. Requests for different libraries run in parallel, so never copy them into the plugin's state. In Go, keep the global values in an sdk.Settings and read each request's with Settings.For(req.GetLibrary()).
  • A key that is present overrides the global value even when it is empty; an absent key means "use the plugin setting". Ignore unknown keys and values that no longer fit, and fall back to the global value.
  • Put the library's overrides into the key of any cache whose entries depend on them (CacheKey() in Go).
  • When an administrator saves a library's settings, the server sends Configure with dry_run and library to check them. Answer with an error and per-field errors, and apply nothing. A plugin that does not support it may return UNIMPLEMENTED; the server then checks only types, options and bounds.
  • A name recognizer whose result depends on the overrides puts a digest of the effective settings into parser_version, so only that library is recognized again when it changes.
  • Changing a library's settings never starts a job; the console offers to scrape the library again.

If an override no longer fits the field (an option was removed, for example), the library's settings page shows it as no longer valid and the plugin keeps using the global value.

Discover#

discover.source provides the pages of the Discover page: tabs, rows of posters, a large featured row, landscape images or entry cards, filters and sort, search, a work's detail page with credits, related rows and external links. A plugin defines its pages; the host has one generic way to show them. work.action gives a work a button, such as a request, with options and a status. The two are independent: implement either or both. They meet only through a work's type and provider_ids, which the host also uses to match a work with the library. Without a plugin that declares discover.source, viewers see no Discover entry at all.

Text is plain text, images always go through the server's image proxy, and every list and call has a limit. The plugin cannot read the library. The member access switch, the per-plugin Library hints for Discover permission and what a plugin receives are described in Discover. The full contract is section 7.12 of PROTOCOL.md and v1/discover.proto. Needs server 0.9.16 or later (host feature discover).

Page actions, subscriptions and the calendar#

Three more capabilities, added in SDK v0.11.0 and server 0.9.17. They are independent of each other, optional and free on every plan, and each has its own host feature: a host that does not announce it never calls the service, so offer what you can as a work action too. Like work.action, they receive member information, and the host stores nothing: it asks each time and shows your text without translating it. The contract is section 7.13 of PROTOCOL.md; the SDK changes are in CHANGELOG.md.

  • page.action (host feature page_actions) puts actions such as "Subscribe" in the header of your own Discover pages: a person, a list, a genre. Declare them in Manifest.page_actions (at most 8, an id and a label) together with discover.source; a page ref means something only to the plugin that gave it. The host calls GetPageState when a page opens (a status_text and up to 4 offers, with options like a work action's) and RunPageAction when the member acts. Return the new state in the response so the host does not ask again.
  • discover.subscriptions (host feature discover_subscriptions) lists what a member follows through your plugin, of any kind you define, and acts on it. ListMemberSubscriptions returns at most 50 per page, newest first within your own pages. An entry has an id, a kind_text, a title and optionally an image, a short status_text and a target (a work or a page of yours; without one the entry does not open, for example a keyword). Actions such as unsubscribe are declared in Manifest.subscription_actions and run through RunSubscriptionAction. Any member can send any id, so check that the subscription belongs to this member.
  • discover.calendar (host feature discover_calendar) lists dates in a window of at most 62 days, up to 500 entries (a work, a date, an optional exact time, a kind such as theatrical, digital, premiere, episode or season premiere, and season and episode for series). The host asks only when the viewer opens the calendar or changes the window, caches the answer for minutes and never polls, so answer from a cache where you can.

New subscriptions from a form. Set Manifest.subscription_form (host feature subscription_form, only with discover.subscriptions) and the host shows a "New" entry for your plugin. GetSubscriptionForm returns a title, a description and up to 12 options; CreateSubscription receives the answers and the host never retries it. An option too big to list, such as people or studios, is marked searchable: the host shows a text box and calls SuggestChoices (at most 20 choices) after the member stops typing for 300 ms. The host does not remember suggestions and checks only the number and length of values, so check every value yourself. WorkOption.hint adds one line of help under an option (host feature work_option_hint).

Several works at once. The optional WorkActionProvider.RunWorkActions runs one action on up to 50 works in a call, with answers in the same order; return UNIMPLEMENTED and the host calls RunWorkAction per work, at most 2 at a time. A refusal of one work does not stop the others, and the host never retries. When the member requests several works together, the confirmation sheet ranks preferences by WorkChoice.tags (at most 4 per choice, each at most 16 characters, such as "4K" or "Subtitled"); a choice without tags counts by its label. Each work gets the choice with the highest-ranked tag, else your default.

Posters from wide images. Work.poster_crop and Work.poster_crop_hint (host feature work_poster_crop) cut the poster out of backdrop_url, with the same ImageCrop and ImageCropHint as metadata images. In Manifest.image_fetch_rules, max_concurrent (1 to 4; host feature image_host_concurrency) lets the host run more background downloads against one image host at a time; downloads a viewer is waiting for keep their own limit.

What the library has. With the new permission discover.library_files (host feature library_files), allowed by the administrator, WorkRef.library_files in GetWorkStatesRequest summarises the library's versions of each work (at most 8): size, height, running time, whether it is a link and the version's name; never a path or file name. Use it to say what the library already has. Off by default and disclosed on the plugin's page. All of this needs server 0.9.17 or later.

Network access#

network.access lets a plugin join the server to another network (an overlay or VPN) so devices on that network reach the server without port forwarding or a public address. The host opens an ingress socket for the plugin and passes its path and a one-time token in the environment; the plugin forwards its network's requests to it as plain HTTP and reports its state (connecting, needs sign-in, needs approval, ready, error) with Host.ReportNetworkAccess, including the https address once ready. Requests through the ingress always count as outside the local network. The administrator signs in and sees the state in the plugin's own settings; the server shows what the plugin reports as given.

network.identity (needs network.access) adds the identity the network proved for each connection, so an administrator can bind it to a member and that member can sign in without a password. The plugin sends a stable subject, a login and a device name per connection and nothing it cannot prove. Optionally it also answers NetworkIdentity.CheckIdentities: from the state it already holds, whether each bound person is still seen on its network (present, absent or unknown; when unsure, unknown). The host asks every few hours and when an administrator presses "check now", and pauses passwordless sign-in for someone who is absent twice, six hours apart. Both capabilities are free on every plan and need server 0.9.18 or later.

A plugin that registered the server on an outside network should leave it in the optional Plugin.Uninstall callback. The host calls it once, only when an administrator uninstalls the plugin (not for disable, upgrade or restart), on the running process with a 10-second deadline; an unimplemented call or an error does not stop the uninstall. The administrator is told that the plugin lets devices outside the local network reach the server. See the protocol document (section 7.14) for headers, limits and the full rules.

Permissions#

A manifest can declare llm (use the AI assistance the administrator has set up; the administrator must allow it for your plugin, and it is off by default) and network.lan (reach devices on the local network, and load images from private network hosts). For network.lan the administrator turns on Local network access on the plugin's page, and the server tells the plugin whether it is on at startup and restarts it when the setting changes. discover.seeds (receive a few library titles and recently watched titles, as IDs only, to build a recommendations tab; off by default and allowed by the administrator for each ID you declare in discover_seed_ids; see Discover above) and discover.library_files (receive a summary of the library's versions of a work, never paths; off by default and allowed by the administrator). The server ignores unknown permissions. Permissions are disclosure, not a sandbox.

Host features#

The server tells a plugin at startup which compatible additions it keeps (for example tasks, checks and image crop), so a plugin can fall back on an older server. The full list is in PROTOCOL.md.

A plugin uses one of these only when the host declares it. The first four come with SDK v0.4.0 and need Kryspal Media server 0.9.6 or later; each of the others lists its own version.

Host feature What it enables
search_confirmed SearchCandidate.confirmed, described above.
badge_suggestions suggested_badge_rules in the manifest, see Plugins and built-in features.
person_backdrop A person's IMAGE_TYPE_BACKDROP in the PersonMetadata.images that GetPerson returns is kept as the person's one backdrop, filling only a missing one. Backdrops returned by GetImages are not used for filling automatically. Send person backdrops only when the host declares this feature.
autofill_limit The host-owned setting autofill_daily_limit limits automatic subtitle downloads per plugin. A subtitle plugin may declare that key only to give its default value.
still IMAGE_TYPE_STILL images of items are kept as stills. Without it, send stills as IMAGE_TYPE_BACKDROP images after the main backdrop. Needs server 0.9.5 or later.
confirmed_numbering Recognition.numbering_confirmed, described above. Needs server 0.9.7 or later (SDK v0.5.0).
library_config Settings per library, described above. Needs server 0.9.9 or later (SDK v0.7.0).
recognition_hint recognition on search and item requests, described above. Needs server 0.9.9 or later (SDK v0.7.0).
lookup_names original_title and product_code on bullet comment and subtitle requests, described above. Needs server 0.9.9 or later (SDK v0.7.0).
subtitle_confirmed SubtitleCandidate.confirmed, described above. Needs server 0.9.10 or later (SDK v0.8.0).
file_paths file_paths on search and item requests, described above. Needs server 0.9.10 or later (SDK v0.8.0).
version_labels version_labels in the item response: names for an item's versions, in the order of file_paths. A version name the user wrote the Emby way comes first, then these, then the label in the file name; each name is at most 20 characters, and a list of a different length than file_paths is ignored. Needs server 0.9.11 or later.