SHADE is young: 0.1.0-next.2 is a pre-release, and 0.1.0 isn't out yet.

SHADE
Writing a plugin

The website module's SDK

The website editor's names for module authors are the website module's, not the module SDK's: its package, @shadestack/module-website, gives them as @shadestack/module-website/sdk and /sdk/testing. Core and the module SDK know no node tree (Core and the website module).

Who needs it

Only a module that gives the website editor components: starter components, handed over as a contribution (contributes: { website: { starters } }, see Contributions). Appointments (Booking, Staff) and commerce (the shop's parts) do. A module that only keeps data, has routes or adds admin screens needs nothing of it.

EntryFor
@shadestack/module-website/sdkShipped code: the tree builders (el, words, show, when, each, slot, use, on, tree, literal, bound, and for formulas formula, binary, call, lit, not, path), the style builders (v, kw, num, px, rem, ch, pct, style, sides, radius, stack, row, columns, fit), the starter helpers (routeCall, stateIs, outcomes, labelledField, introHead, themeBorder, themeButton, themeControl, themeHeading, themeIntroStyles, with t(key) for a text and StarterWords, StarterExpression, StarterValue, StyleDeclarations), NodeTree and TreeNode, and how a page's bindings read fields, a data source's items, the site and the visitor (fieldExpressionType, fieldsExpressionType, sourceItemType, bindableValues, SITE_EXPRESSION_TYPE, VISITOR_EXPRESSION_TYPE).
@shadestack/module-website/sdk/testingTests only: checkComponent(starter, { uses }), a starter checked as the editor checks it when an admin adds it (the loaded modules' data sources and visitor routes, the default theme's variables), with ComponentInCode and CheckComponentOptions.
import { el, introHead, routeCall, t, tree, words } from '@shadestack/module-website/sdk'

const call = routeCall('bookings')
export const STARTERS = [{
  name: 'bookings-slots',
  // keys in the module's locales/<language>.json: { "starters": { "slots": { "label": "Free times", … } } }
  label: t('starters.slots.label'),
  description: t('starters.slots.description'),
  component: { tree: tree(introHead('slots'), el('slots-list', 'ul', [/* … */])) }
}]

// test/server/starters.test.ts
import { checkComponent } from '@shadestack/module-website/sdk/testing'
expect(checkComponent(STARTERS[0], { uses: STARTERS })).toEqual([])

Every text in a starter is a key, t('starters.…'), in the giving module's locale files: the website module reads labels in the admin's language and the words it places in each of the site's languages, so a language is one more file. checkComponent takes the keys as they are. Call it after loadModules([plugin], …), so the module's data sources and visitor routes are known. The worked examples are the appointments and commerce modules' server/starters.ts with their test/server/starters.test.ts.

An optional peer

A module that gives starters works without the website module installed. Its package.json takes the website module's package as an optional peer and as a dev dependency:

{
  "peerDependencies": { "@shadestack/module-website": "^0.1.0" },
  "peerDependenciesMeta": { "@shadestack/module-website": { "optional": true } },
  "devDependencies": { "@shadestack/module-website": "workspace:*" }
}
  • shade-module build bundles the builders the module uses into its package, so nothing of the website module is imported at runtime, and the starters themselves are plain JSON.
  • The module never requires the website module. Its starters count only while both modules are installed and on; without the website module they are simply not registered, and everything else of the module works as before.
  • The website module checks a given starter as any component when an admin adds it, and refuses raw HTML in it: a module can't give what an admin couldn't build.

Without the website module

An instance without the website module has no pages, no components and no theme, but a module's data and actions stay reachable for a frontend a developer builds:

  • Typed route answers. A public or account route that says what it answers (answer, a zod schema) is checked against it before it is sent, and is described in the OpenAPI document (/api/v1/openapi.json), so a frontend can type it or generate a client (What a route answers).
  • Read models. A module's read routes under /api/v1/content/<plugin> are read with the read client's read<T>(path, query) (@shadestack/core/sdk), the caller naming the answer's type (The API).
  • Routes from the browser. callAccountRoute(plugin, path, options) (@shadestack/client/account) calls a public or account route with the visitor's session cookie, through the same rate limits and checks as a page's islands (Accounts: sign-in and modules' routes). solveChallenge (@shadestack/client/challenge) solves a module's proof-of-work challenge (GET /challenge, ALTCHA) in the browser and returns the answer to send as altcha.
import { callAccountRoute } from '@shadestack/client/account'
import type { SlotsAnswer } from 'bookings/shared'

const slots = await callAccountRoute<SlotsAnswer>('bookings', '/slots', { query: { from: '2026-11-09' } })

So keep what a starter shows in the module's routes and read models, not in the starter: the starter is one way to show it, a developer's own component is another.

Its version

@shadestack/module-website has a version of its own, apart from SHADE's, as the framework adapters have. Its CHANGELOG.md has a section per release, saying which SHADE versions it works with (its peer range on @shadestack/module-sdk and the module's shade range, ^0.1.0 today) and what changed for modules built on its SDK. Take it with a caret range within one major, as above; before 1.0, ^0.1.0 is 0.1.x only.

A starter carries the node tree's schema version: tree(…) writes the version of the tree format the SDK was built with ({ version, nodes }). The website module checks it when an admin adds the starter: a tree of another version is refused with a version message (one from a newer format "was written by a newer SHADE"), and nothing is added. So a module that gives starters is built against a website module whose tree format the installed one reads, and a release of the website module that changes the tree format says so in its changelog.