Skip to content

Building extensions ​

An extension is a folder with a manifest.json and the files it loads: HTML, JavaScript, CSS, images. Sorus installs, updates and removes it as one. It can bring:

What it isManifest key
TypesKinds of object, with fields and templatestypes, templates
AppsPlaces in the sidebar, each with screensapps (or screens)
ViewsWays to draw a saved view in Objectsviews
BlocksWays to draw one object inside a pageblocks
CommandsPalette entries, with optional shortcutscommands
JobsScripts that run in the backgroundjobs

An extension needs at least an app, a view, or a type. One that only brings types (Basics, mostly) is fine.

How an extension reaches Sorus ​

Every screen, view, block and job is a web page that talks to Sorus through the SDK. Sorus checks every call against what the extension was granted:

  • its own types, which it may read and write;
  • the uses its manifest asks for, such as reading pages or writing the calendar, which the person approves at install;
  • the network hosts it lists, reached only through Sorus.

Third-party extensions run in a sandboxed frame with no network of its own. Extensions signed by Sorus may instead run as modules in Sorus's own window. Both get the same API, checked the same way.

Start here ​

Sorus's own extensions, in the pages-apps repository, are good examples: Movies (types, an app with three screens, a block, a command), Basics (types, templates, an app, a view), Letterboxd (adds to Movies' types, a job, network), GitHub (a connection and a job).