App extensions
An extension is a page of your workspace’s custom app that Tessule shows inside one of its own pages, as the member viewing it. A panel on an invoice’s record page can show the scanned PDF with the fields read from it; a panel on a job can draw its route on a map; a tile on the home page can list the week’s visits; a page of its own can hold a planning board. The page is your code, built with whatever you like, and it sits beside Tessule’s own content.
The place an extension is shown is its target:
| Target | Where it shows | Placed in |
|---|---|---|
record.block |
A panel on a record page, beside the record it is looking at. | A table’s record layout. |
home.tile |
A tile on the home page. | The home page, like any other tile. |
dashboard.tile |
A tile on a dashboard, following the dashboard’s variables. | The dashboard, like any other tile. |
app.page |
A page of its own in Tessule, at /x/<site id>/<extension id>/. |
The navigation, or a quick link. |
The first part of this guide is for members and admins; from
Building an extension on it is for whoever writes
the extension, person or AI. An AI client connected over MCP reads the same
contract with get_hosted_site_authoring_guide (section extensions).
What an extension can do as you
Section titled “What an extension can do as you”An extension runs in a frame on your custom app’s own address, not on Tessule’s. Each panel, tile and page says Provided by your workspace’s custom app, so you can always tell its content from Tessule’s.
The first time you meet an extension, it asks first: “Invoice scanner is provided by your workspace’s custom app and will act as you with:” and the actions it declares, such as reading records or reading attachments. The question takes the extension’s place in the panel, tile or page. Allow lets it act; Not now folds the question to one line, “Invoice scanner needs your permission before it can load.”, with the same button, and the extension does not load until you allow it. If a later version of the extension asks for more, it asks again and marks what is new. Allowing an extension also allows those actions for the custom app itself.
Once allowed, an extension (a panel, a tile or a page):
- acts as you, never as more. It reads and writes through the workspace API with your own role, record access and field visibility, narrowed to the actions you allowed. A record you cannot open in Tessule is absent for the panel too, and a field hidden from you is hidden from it.
- cannot manage the workspace. Members, groups, roles, tokens, secrets, integrations and the custom app itself are out of a panel’s reach, whatever your role.
- sees where it is shown. Tessule hands it who you are and the app’s theme, and on a record page the record’s id, table and the values you can see; on a dashboard, the dashboard and the values its variables are set to; on a page of its own, where in that page you are.
- can ask Tessule to act on the page: show a short notice, go to another of Tessule’s own pages (never an outside address), or open a dialog showing another page of the same extension. On a record page it can also reload the record, set a field on the open record form, or resize itself. A field it sets is checked the way the form checks your own typing, and it is only an edit on the form: nothing is saved until you press Save.
- cannot reach your Tessule sign-in. It never receives your session, and it cannot sign you in or out of anything.
An extension’s access ends when you sign out of Tessule, change your password or leave the workspace, and when you sign out of the custom app; the next time you open it, it starts afresh. Signing out of the custom app also forgets what you allowed, so each extension asks again.
Placing an extension
Section titled “Placing an extension”Each target is placed where Tessule’s own content of that kind is arranged. Every list of extensions to place comes from the custom app’s live deployment and offers only the extensions declared for that target.
A panel on a record page
Section titled “A panel on a record page”An admin with the Manage branding and layouts permission (customization:manage)
and access to the builder (builder:access, which opens Table Administration)
places a panel the way they arrange any other part of a record page:
- In the sidebar, open Table Administration, and choose Edit Schema on the table.
- In the Record page layout section, choose Add panel. The list includes every extension of the custom app’s live deployment meant for this table.
- Put the panel on the tab you want, set when it shows, and save.
To make a panel the whole page, give the layout tabs: put the panel alone on the first tab and every field section on a second. The fields stay one click away, and a field added later appears on the first tab, so nothing is hidden from someone allowed to see it.
A record page holds at most four extension panels. A panel whose extension the live deployment no longer declares stays in the layout: admins see a “Not in the current deployment” line in its place and other members see nothing, and activating a deployment that declares it again brings it back.
A tile on the home page
Section titled “A tile on the home page”- On the home page, choose Customize, then Add tile.
- Choose App extension and pick the extension by name.
- Set Heading if you want one other than the extension’s name, place and size the tile, and save the page.
Admins with Manage branding and layouts arrange the page the workspace or a group lands on; members who can customize their own home page add tiles to it the same way. The tile starts as tall as the extension asks for.
A tile on a dashboard
Section titled “A tile on a dashboard”A member with the Manage dashboards permission (dashboards:manage) opens
the dashboard, chooses Edit, then Add tile, chooses App extension,
picks the extension and saves the dashboard.
The tile is told which dashboard it is on and the values the dashboard’s
variables are set to, as text: a list is joined with commas, a date range is
its preset or from/to, and a variable left on “All” is left out. When you
change a variable, the tile hears the new values.
A home page and a dashboard each hold at most four extension tiles; once a page holds four, App extension is offered disabled, with the reason. A tile whose extension the live deployment no longer declares stays on the page: admins see a “Not in the current deployment” line in its place and other members see nothing.
A page of its own
Section titled “A page of its own”An app.page extension has its own address in Tessule,
/x/<site id>/<extension id>/, and anything after it is the extension’s own
route: /x/<site id>/<extension id>/visits/today opens it at /visits/today.
Members reach it from:
- the navigation. An admin with Manage branding and layouts opens Settings → Navigation, and in Add a page picks the extension under Custom app. The entry is named after the extension unless you give it a label.
- a quick link. On the home page, a Quick links tile offers the extension’s page under Custom app like any other destination.
The page’s heading and the browser tab show the extension’s name. The
extension is told the route and query it was opened at, and hears about every
move within it. It moves within itself with
ext.host.navigate({ kind: "extensionPage", path: "/visits/today" }): a
target without extension names the extension’s own page, so it never needs
its site’s id. The address changes, the back button returns, and the same page
hears the new route without reloading. A link to an extension the live deployment no longer declares
is not shown; opening its address shows admins the “Not in the current
deployment” line and other members nothing.
Building an extension
Section titled “Building an extension”An extension is a directory of your custom app’s build, ext/<id>/, with an
index.html, declared in one file, tessule.site.json, at the root of the
built directory. It is deployed, rolled back and pruned with the rest of the
app: there is no separate upload.
Declaring it
Section titled “Declaring it”{ "extensions": [ { "id": "invoice-scanner", "name": "Invoice scanner", "description": "Shows the uploaded invoice with the fields read from it.", "target": "record.block", "path": "/ext/invoice-scanner/", "scopes": ["records:read", "records:update", "attachments:read", "tables:read"], "height": { "initial": 480, "min": 160, "max": 1200 }, "tables": ["invoices"] } ]}The invoice scanner reads the record, its attachment and the table’s fields, and edits the record: an extension asks only for what it needs, since members allow every scope it lists.
| Key | Rule |
|---|---|
id |
Lowercase letters, digits and -, starting with a letter or digit, at most 40 characters, unique in the deployment. A placed panel, tile or link names the extension by it, so renaming it unplaces them. |
name |
1 to 60 characters: the title of the panel, tile or page, the entry in the lists you place it from, and the consent question. |
description |
Optional, at most 300 characters, shown to the admin placing it and in the consent question. |
target |
record.block, home.tile, dashboard.tile or app.page. |
path |
Exactly /ext/<id>/; the build must contain /ext/<id>/index.html. |
scopes |
The actions the extension acts with, each one an action a custom app session can hold (see What a session can hold). Members allow exactly this list. Ask for the least the extension needs. |
height |
Optional, and refused on app.page, which fills the page. In CSS pixels: initial, and optional min and max, whole numbers from 120 to 2000 with min ≤ initial ≤ max. Without it the panel opens at 400 pixels. The page resizes the panel within these bounds; a tile starts as tall as initial and keeps the size it is given. |
tables |
Optional, and on record.block only: table ids or names the extension is meant for; Add panel offers it only on those tables. Without it, every table offers it. |
A deployment declares at most 20 extensions, unless your workspace’s limit says otherwise.
Use relative addresses only. Tessule loads the extension’s page under a
prefix of its own, so the extension’s pages, stylesheets and scripts load
nothing from an address that starts with / or \ (src="/app.js",
href="/app.css", url(/logo.png), import "/x.js"); /_api and /_auth
are the exceptions. A Vite build with
base: './' and the extension’s directory as its root produces exactly this,
and a hand-written page with relative imports does too.
A frame loads only from its own extension’s directory, /ext/<id>/: a
relative address that climbs out of it (../assets/app.js, which one Vite
build for several extensions writes for the chunks they share) is refused
too. Build each extension on its own, as the starter does.
Starting from the starter kit
Section titled “Starting from the starter kit”npm create @henrycpainter/tessule-app my-app -- --extension invoice-scanner(or answer yes when the starter asks whether to add an extension). Beside the app it creates:
ext/invoice-scanner/, the extension’s page, with its own Vite entry;public/tessule.site.json, declaring it (copied intodist/by the build);vite.ext.config.tsandbuild-ext.mjs, the extensions’ build: each directory ofext/builds on its own (its directory as the root,base: './') intodist/ext/<id>/, so everything a page loads is inside its extension’s directory;ext/_dev/, a development page that stands in for Tessule and frames the extension;- the scripts
npm run build(the app’s build, then each extension’s),npm run build:ext(the extensions only),npm run dev:ext(the extension with hot reload, framed by the development page athttp://localhost:5174/_dev/) andnpm run check.
Open the development page with ?table=<table id>&record=<record id> to frame
the extension with a real record, read as you through the /_api proxy with
TESSULE_TOKEN; without them it uses a sample record. ?ext=<id> picks the
extension when there are several.
Building with an AI assistant, without a registry
Section titled “Building with an AI assistant, without a registry”The archive get_workspace_sdk answers (see
Building with an AI assistant, without a registry)
carries the extension client, client/extension.js with its types, the
development host client/extension-dev.js, and examples/extension/: a
complete extension page with no build step, which lists the record’s fields
and sets one on the form. Lay the build out like this, copying the archive’s
client/ directory beside the page:
tessule.site.jsonindex.htmlext/fields/index.htmlext/fields/tessule/client/extension.jsext/fields/tessule/client/index.js…The page imports ./tessule/client/extension.js, so there is nothing to
bundle: archive the directory and deploy it with deploy_site.
Connecting to Tessule
Section titled “Connecting to Tessule”import { connectExtension } from '@henrycpainter/client/extension';// without a registry: import { connectExtension } from './tessule/client/extension.js';import { createWorkspace } from './tessule-ws';
const ext = await connectExtension();const ws = createWorkspace(ext.client);
ext.autoResize();ext.applyTheme();ext.onContext((context) => render(context.record));
await ext.host.setFieldValue('total', 1234.56);await ext.host.toast({ message: 'Total read from page 1', severity: 'success' });-
connectExtension()resolves once Tessule has handed the page its context. Opened on its own, outside Tessule, it rejects after five seconds with aTessuleClientErrorwhosekindisnot-framed; show a message saying the page belongs inside a record.timeoutMschanges the wait, andhostOriginsnames the development page’s origin when you work under it. -
ext.contextalways holdstarget, the workspace and the viewer (with their permissions), and what the target adds:Target Adds record.blockrecord(tableId,tableName,recordId,updatedAt, andfieldsas the viewer sees them) andform.dirty, whether the form has unsaved edits.home.tileNothing more. dashboard.tiledashboard:id, andvariables, the variables’ current values by name, as text.app.pageroute:path, the route after the page’s address, starting with/(/at its root), andquery, the query parameters by name (a repeated name keeps its last value).ext.onContextcalls back now and whenever any of it changes. The field values are a snapshot; read more through the API. -
ext.clientcalls the workspace API as the viewer, through the custom app’s own/_api. Pass it tocreateWorkspacefor your workspace’s typed table accessors. It renews its credential by itself when it expires. -
ext.hostasks Tessule to act:resize,toast,navigate(to one of Tessule’s own pages, named the way quick links name them),refreshRecord(after the extension wrote the record through the API),setFieldValue,reauth,error(the extension cannot work: Tessule replaces the panel with the message, cut to 300 characters),openModalandcloseModal(see Opening a dialog), andscan(see Scanning a code). On a page of its own,navigate({ kind: 'extensionPage', path: '/detail' }), with noextension, moves within that page; a panel or tile has no page of its own, so it is refused there, and namingextensionopens another page of the custom app. Each resolves once done, and rejects withkindbridge-refusedand Tessule’s reason when refused.refreshRecordandsetFieldValuework on a record page only; a tile or a page fills the space it is given, soresizechanges nothing there. A tile’s or page’stoastshows in a notice at the bottom left of the window, headed with the extension’s name. -
ext.autoResize()keeps the panel as tall as the page;ext.applyTheme()sets Tessule’s colours as--tessule-<name>CSS variables and follows light and dark mode.
@henrycpainter/client/extension/dev exports createDevHost, the host side
the starter’s development page uses: it frames the extension, hands it a
context and prints what the extension asks for. Its onOpenModal option
answers an openModal; a page that shows the dialog frames it with a second
createDevHost({ modal: { onClose } }), whose onClose receives the value the
dialog closes with. Its onScan option answers a scan; without one it asks
with the browser’s prompt(), as a handheld scanner would type the code.
Scanning a code
Section titled “Scanning a code”An extension asks Tessule to read a barcode or QR code, and Tessule opens its own scanner: the camera, or a code typed or read by a handheld scanner.
const scanned = await ext.host.scan({ title: 'asset tag' });if (scanned !== null) { // scanned.code: the text read; scanned.format: 'qr_code', 'code_128', …, or null when typed}- The scanner is headed “Scan” and the
title, or “Scan a code” without one. - It resolves with
nullwhen the viewer cancels, and is refused while the scanner is already open. - The extension never sees the camera or its video, only the text read. An extension’s frame cannot open the camera itself.
- Look the code up with the API as any typed code, for example
findRecordsByCode(scanned.code)from@henrycpainter/client/scan.
Opening a dialog
Section titled “Opening a dialog”An extension can open another page of itself in a dialog over Tessule’s page, such as a picker or a form, and get back what it chose:
// The opener: a panel, tile or page.const picked = await ext.host.openModal({ path: 'pick-customer', title: 'Choose a customer', size: 'large' });if (picked !== undefined) render(picked);
// ext/<id>/pick-customer, the same extension: connect as usual, thenawait ext.host.closeModal({ customerId: 'rec_0123abcd' });pathis a route inside the extension’s own folder, without a leading slash: lowercase letters, digits and. _ / -, starting with a letter or digit, with no..segment, at most 256 characters. A path without a file extension serves the extension’sindex.html, so the page tells which route it is showing from the end oflocation.pathname. That page resolves its relative addresses from the path’s folder, which for a path of more than one segment is the wrong one: use a single segment, such aspick-customer, or an.htmlfile, such asdetail.html. A path outside the extension is refused before anything opens.- The dialog shows the same extension, never another, with the same target and context as the page that opened it and a credential of its own.
title, at most 100 characters, heads the dialog (the extension’s name without one);sizeissmall,mediumorlarge(mediumwithout one).openModalresolves when the dialog closes: with the value the dialog’scloseModalcarried, orundefinedwhen the member closed it. Anavigatefrom the dialog closes it first.- A frame has one dialog open at a time; a second
openModalis refused. A dialog cannot open another dialog, andcloseModalfrom a frame that is not a dialog is refused.
The messages between Tessule and the page
Section titled “The messages between Tessule and the page”The client wraps a small postMessage protocol; a page that does not use the
client speaks it directly. Every message is
{ "tessule": 1, "id"?: string, "type": string, … }, and each side accepts
messages only from the other’s origin. The shapes are the
ExtensionHostMessage and ExtensionFrameMessage schemas of the API
reference.
| From Tessule | Carries |
|---|---|
init |
The page’s credential, the context, the theme and Tessule’s origin; sent in answer to ready, and again with a new credential. The client uses the latest one. |
context |
A new context: the record was saved or reloaded, the form changed, the dashboard’s variables changed, or the member moved within the extension’s page. |
theme |
A new theme. |
result |
The answer to a page message that carried an id: ok, and error when refused. |
close |
Tessule is removing the panel, tile, page or dialog. |
| From the page | Asks for |
|---|---|
ready |
init. |
resize |
A height, kept within the extension’s bounds. |
toast |
A notice, shown as plain text, cut to 300 characters. |
navigate |
One of Tessule’s own pages; an extensionPage without extension is the extension’s own page. |
refreshRecord |
The record reloaded, then a fresh context. |
setFieldValue |
One field set on the open form, checked as the form checks it; never saved. |
reauth |
A new credential, then a fresh init. |
error |
The panel replaced with the message given, as plain text cut to 300 characters. |
openModal |
A dialog showing path of the same extension; answered when it closes, with the value it closed with. |
closeModal |
From a dialog: close it, handing value to the page that opened it. |
Showing an attachment
Section titled “Showing an attachment”An extension can draw a record’s file itself, a PDF with pdf.js for
instance. Ask for the file’s address with
GET /tables/{tableId}/items/{itemId}/fields/{fieldId}/attachment, which
needs the attachments:read action, then fetch the downloadUrl it returns
straight from the extension. The address is signed for that one file and
expires within minutes: it is the only credential the download needs, so the
fetch works from the custom app’s address, a custom domain included. A
fetch for the whole file, without Range headers, is one plain request.
Deploying and placing
Section titled “Deploying and placing”Deploy as you deploy the custom app (see
Deploying a build). Every
deployment answer lists the extensions it declared and, for each, where to
place it: for a panel, a sentence naming the table’s layout and, when the
table exists, a link to its records where the panel appears once placed; for a
tile or a page, a sentence naming where it is added. tessule deploy
prints them; deploy_site returns them.
From an AI session
Section titled “From an AI session”An assistant connected over MCP, with no tools of its own, goes from “I want a panel” to a placed panel like this:
get_hosted_site_authoring_guidewith sectionextensions: the declaration, the relative-address rule, the messages and the placement steps.get_workspace_sdk: the client andexamples/extension/.- Write
tessule.site.jsonandext/<id>/index.html, archive the built directory and calldeploy_site. Its answer lists the extension and where to place it. - Place it. For a panel:
call_operationwithtablesTableIdRecordLayoutGet(GET /tables/{tableId}/record-layout), add{ "kind": "extension", "extension": { "siteId": "<site id>", "extensionId": "<id>" } }toblockswith a newid, andcall_write_operationwithtablesTableIdRecordLayoutPut. A tile is the same placement in a tile of kindextension, saved withworkspaceHomepagePutordashboardsDashboardIdPut; a page is a navigation entry whose target is{ "kind": "extensionPage", "extension": { … } }, saved withworkspaceNavigationPut(a stored entry always names itsextension; only the page itself, moving within itself, leaves it out). The site id is thesiteIdofGET /hosted-site/extensions. - For a panel, give the person the record link from the deploy answer; for a
tile or a page, tell them where it was placed. They allow the extension and
see it. Each change is another
deploy_site; activating an earlier deployment in Settings → Custom app rolls it back.
The assistant cannot see the extension itself. When something behaves differently
from the guide, it reports it with report_issue.
From git and CI
Section titled “From git and CI”- Build:
npm run buildruns the app’s build and the extensions’. - Check:
npx tessule check distchecks the built directory without sending anything or needing a credential:index.htmlpresent, the declaration’s shape, the targets, the scopes, the height bounds and every extension page’s addresses. It printsok: N files, M extensionsor each problem on its own line, and exits non-zero on a problem;--jsonprints{ ok, files, extensions, problems }. Tessule checks the declaration again when a deployment is created, against your workspace’s own limits. It reads the extension pages’ addresses only when it receives the build as one archive (deploy_site, orPOST /hosted-site/deployments/archive);tessule deployuploads the files one by one, so its own check is the one that reads them. - Deploy:
npx tessule deploy distuploads what changed, makes it live and prints each extension’s placement.--no-activateleaves the deployment ready for a person to switch on in Settings → Custom app.
The deploy credential is a role-only API token whose one role holds
hostedSites:manage (see
Deploying a build). Store it
as a repository secret. A GitHub Actions workflow that checks every pull
request and deploys main:
name: Custom appon: pull_request: push: branches: [main]
permissions: contents: read packages: read
jobs: build: runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # reads the starter's packages steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 - run: npm ci && npm run build && npx tessule check dist - if: github.event_name == 'push' && github.ref == 'refs/heads/main' run: npx tessule deploy dist env: TESSULE_TOKEN: ${{ secrets.TESSULE_TOKEN }}Rolling back is activating an earlier deployment in Settings → Custom app, or reverting the commit and pushing.
Troubleshooting
Section titled “Troubleshooting”| You see | It means |
|---|---|
tessule check or a deploy reports extension "<id>": path must be "/ext/<id>/" (or another rule) |
The declaration breaks the rule named; each problem names the file or extension and the key. |
…: url() "/logo.png" is an absolute path; an extension is served under its own route… |
A page or stylesheet of the extension loads from an absolute address. Make it relative (./logo.png), or build with base: './'. |
extension "<id>": scope "…" is outside what a site may use |
The extension asks for an action no custom app session can hold. |
| The panel asks for permission again | A deployment declared actions you had not allowed. Allow them to continue. |
| This panel did not load. with a link to open it in the custom app | The page did not answer within ten seconds: it failed to load, or never called connectExtension. The link opens the page on its own, where its own error shows. |
| This panel could not be opened. | Tessule could not start the panel. The message beside it says why. |
| A “Not in the current deployment” line (admins only) | The live deployment no longer declares the extension. Deploy one that does, or remove the panel from the layout. |
The page says it is outside Tessule (not-framed) |
The page was opened on its own, not inside a record page. |
403 with code PERMISSION_DENIED from the API |
The viewer, or the actions they allowed, do not cover the action; the message names it. |
403 with code SITE_ROUTE_NOT_EXPOSED |
No custom app may call that operation (see What an app may call). |
401 from the API |
The panel’s credential ended; the client asks Tessule for a new one by itself. A page without the client sends reauth. |
A setFieldValue rejected with bridge-refused |
The form refused the value, or the field is not on the open form; the reason says which. |
extension "<id>": tables applies to record.block only |
Only a record panel takes tables; remove it from a tile or page. |
extension "<id>": height does not apply to app.page |
A page fills Tessule’s page; remove height. |
…: attribute "../assets/x.js" resolves to /ext/assets/x.js, outside /ext/<id>/; a frame can only load files inside its own extension directory |
The page loads a file outside its extension’s directory, so the frame cannot reach it. Build each extension into its own dist/ext/<id>/ (the starter’s npm run build:ext), or keep the file inside that directory. |
400 with code EXTENSION_SITE_UNKNOWN when saving a layout, a home page, a dashboard or the navigation |
A placement’s siteId is not your workspace’s custom app. Read it from GET /hosted-site/extensions. |
| Saving a layout refused for its extension blocks | A layout holds at most four extension panels. |
| App extension offered disabled in Add tile | The home page or dashboard already holds four extension tiles. |
| This address is not a page of this extension. | The address after /x/<site id>/<extension id>/ is not a route the extension can show: lowercase letters, digits and . _ / -, with no .., at most 256 characters. |
A navigate rejected with bridge-refused |
The destination is not one the viewer can open in Tessule, or a panel or tile sent an extensionPage without extension, which only a page of its own has; the reason says which. |
An openModal rejected with bridge-refused |
The path is outside the extension, the title is over 100 characters, a dialog is already open from that frame, or the frame is itself a dialog; the reason says which. |