Manifest builder
Describe your add-on and get a manifest.json that follows protocol v1, to copy or download, plus starter code for the SDK.
Everything happens in this page: nothing you type is sent anywhere.
manifest.json
Valid for protocol v1.
{
"id": "org.example.readings",
"version": "1.0.0",
"protocol": 1,
"name": "Example Readings",
"description": "Public-domain books read by volunteers.",
"types": [
"audiobook"
],
"resources": [
"catalog",
"meta",
"stream"
],
"idPrefixes": [
"example:"
],
"catalogs": [
{
"type": "audiobook",
"id": "new",
"name": "New releases",
"extra": [
{
"name": "skip"
}
]
}
]
}Serve this at /manifest.json under your add-on’s base URL. The manifest is a promise: answer every route it declares, as the protocol describes.
Starter code
The same manifest as src/addon.ts for the template, with an empty handler for each resource. Replace the template’s file with it and fill in the handlers; in a project of your own, npm install @lelap/sdk hono first, as the SDK guide shows. Other languages: see the samples.
import { createAddon, type Manifest } from '@lelap/sdk';
export const manifest: Manifest = {
"id": "org.example.readings",
"version": "1.0.0",
"protocol": 1,
"name": "Example Readings",
"description": "Public-domain books read by volunteers.",
"types": [
"audiobook"
],
"resources": [
"catalog",
"meta",
"stream"
],
"idPrefixes": [
"example:"
],
"catalogs": [
{
"type": "audiobook",
"id": "new",
"name": "New releases",
"extra": [
{
"name": "skip"
}
]
}
]
};
export const addon = createAddon({
manifest,
// Answer { metas: MetaPreview[] }; extra has search, genre and skip as strings.
catalog: async ({ type, id, extra }) => {
return { metas: [], cacheMaxAge: 3600 };
},
// Answer { meta: Meta }, or null for an ID you don't know (a 404).
meta: async ({ type, id }) => {
return null;
},
// Answer { streams: Stream[] }; an empty list when you have nothing.
stream: async ({ type, id }) => {
return { streams: [] };
},
});
Check a manifest
Paste a manifest.json you already have, such as the one your add-on serves, to check it against the same rules.