A Temps plugin is an ordinary Temps service: it runs from a container image,
and an administrator adds that service as a plugin. Adding a plugin does not
restart Temps. This template is a working plugin with a sidebar page, the
Dockerfile it runs from and a workflow that publishes its image.
It needs a Temps release in which plugins run as services (after
v0.1.0-beta.65). The commands below use the Temps CLI as temps;
bunx --bun @temps-sdk/cli runs the same CLI without installing it.
Use Use this template on GitHub to create your own repository, and install Bun 1.4.2.
Rename the identity in package.json: name, author, repository (the
GitHub address of your repository), description, and temps.name and
temps.title. A release from a copy of the template is refused until you do.
Then write the plugin: src/index.ts holds the manifest, navigation and routes,
and src/page.ts the sidebar page. The example serves its page at /ui/ and
JSON at /.
bun install
bun test
bun run checkRun it locally in the plugin simulator, which serves a preview of the plugin as Temps would show it:
bunx --bun @temps-sdk/cli plugin dev --exec bun -- run src/index.tsTry it on a Temps instance. This builds the Dockerfile here, uploads the
image and adds the plugin; no registry is needed:
temps plugin add --buildCommit bun.lock with the source; the image is installed from the lockfile.
Review dependencies and build scripts before you build or run any plugin:
building source executes code from that repository.
The plugin needs no configuration to be reachable. Started without arguments, as its container starts it, the SDK reads what every Temps deployment receives:
| Variable | Use | Default |
|---|---|---|
PORT |
the port to listen on | 8080 |
TEMPS_PLUGIN_SECRET |
the secret Temps gave this deployment, and presents to it | required |
TEMPS_PLUGIN_DATA_DIR |
where the plugin keeps its files; mount the service's volume there | /data |
Temps presents the deployment's secret in the x-temps-auth-signature header
of every request. Only the health route answers a caller without it.
src/service.test.ts starts the plugin this way and checks both.
A newly added plugin has no permissions. An administrator grants what it asks for, and approves each new build before it runs as the plugin. The plugin then appears in the platform sidebar; open it to see its page.
Set version in package.json, commit, and push a tag v followed by that
version:
git tag v1.0.0
git push origin v1.0.0The Publish image workflow checks that the tag matches package.json (and,
in a copy of the template, that the identity is renamed and repository names
this repository), then builds the Dockerfile for linux/amd64 and
linux/arm64 and pushes it to the GitHub Container Registry of this
repository.
A new package on ghcr.io starts private. Make it public once, in the
package's settings under Change visibility, before other Temps instances
can pull it.
The workflow's run summary prints the line to share:
temps plugin add --image ghcr.io/your-org/your-plugin@sha256:<digest>It adds exactly the image that was built, named by its digest. In the console, Settings > Plugins > Add plugin takes the same image.
To update a plugin an instance already has, run the same command with
--project <service> and the new image. The new build waits for an
administrator's approval; until then the approved build keeps running as the
plugin.
A listed plugin shows a one-step Add in Settings > Plugins. Open a pull
request to gotempsh/plugins that adds
registry/<plugin-name>.json with repo (your repository), categories, and
the image and commit the workflow's summary printed. The format is described
in the catalogue's
registry/README.md.
A new version is another pull request there that changes image and commit.
The catalogue previews come from temps.screenshots in package.json. Replace
the light and dark PNGs in assets/ with screenshots of your own plugin, and
update each repository-relative path, descriptive alt, and optional
caption. Capture only the plugin UI: never include credentials, account
details, or private project data. The catalogue reads these paths at the
commit the listing names, so new screenshots appear with the next listing
update.
The Test plugin workflow runs the tests, the type check and a build of the
image for every commit and pull request. The Publish image workflow runs
only for a version tag. Neither needs a secret beyond the repository's own
GITHUB_TOKEN.