Skip to content

Extension targets

A target is a named place in the Sessions UI. An extension declares the targets it renders into, and each one gets its own module and its own typed API.

Target names

Target names are DNS-style: dot-separated, kebab-case labels, most general first — <surface>.<resource>.<place>.<slot>.

business | public
The surface — who is looking: the staff-facing admin, or buyers on the public page and in embeds.
session
The resource the target is about — the record the extension receives as its subject.
details
The place that resource appears on the surface.
block | row
The kind of space the extension gets: a card of its own, or rows in a list the page already draws.
extensions/session-note/sessions.extension.json
{
  "handle": "session-note",
  "name": "Session note",
  "targets": [
    {
      "target": "business.session.details.block",
      "module": "./business.tsx",
      "query": "./SessionNoteQuery.graphql"
    },
    {
      "target": "public.session.detail-list.row",
      "module": "./public.tsx",
      "query": "./SessionNoteQuery.graphql"
    }
  ]
}

Declaring targets

Each entry in targets names a target, the module whose default export renders it, and optionally a .graphql file with its live query.

Point each target at its own module, and name the target again in extension(target, …): TypeScript then gives api that target’s exact shape — api.mutate only exists on business targets — and the host checks at runtime that the module is mounted where you meant.

Blocks and rows

The last label of a target’s name says what kind of space you get.

*.block
A card of your own, headed by your app’s icon, the extension’s name and “From <app>”, with a “…” menu for the business. Lay out whatever you need inside it.
*.row
Rows inside a list the page already draws — the session sheet’s price, time and location — with no card and no heading. Render <sessions-detail-row> elements, and <sessions-detail-row-skeleton> while you load.
Render nothing when you have nothing to say. An empty block isn’t drawn, and an empty row target leaves the list exactly as it was.

Targets

Two targets today, both beside one session. More surfaces follow the same shape.