Installing and Updating

This page covers the lifecycle of an installed theme from the developer’s side: how an archive gets onto a server, what happens at activation, how updates and rollback work, and where files live. The operator’s view is in the Appearance admin guide.

Distribution

  • Themes are distributed only as .tgz archives. There is no package registry.
  • Operators install an archive in Site & Content › Themes. Uploading needs the appearance:install permission, held by super admins and by the seeded Theme manager group.
  • Official archives may ship inside the product image as pre-installed, inactive themes under themes-bundled/ (source Bundled). None ships today. Theme sources, including the samples, are never shipped.
  • The built-in theme default is never uploaded and never appears as an archive.

Upload and validation

  1. The archive (at most 30 MB) is checked for format, path safety and size, then validated against every rule in Validation and Scanner Rules. The parent named in extends must be installed.
  2. A rejected archive is not installed; the report names the rule, file and line.
  3. An accepted archive is unpacked to themes/<slug>/<version>/ on the server’s themes volume and recorded as installed and inactive.
  4. The theme’s strings are seeded into the phrase table, skipping keys that already exist.

Preview and activation

  • Preview applies the theme to the operator’s own browser only: a one-hour cookie on the admin session that the public theme endpoints honour for a signed-in admin. Stop preview ends it.
  • Activate sets the theme as the player theme. Players see it only while Show the active theme to players is on; with it off, the public endpoints answer default whatever is active.
  • On activation every connected browser receives appearance_updated, fetches the theme configuration again, loads the bundle and the theme’s stylesheet, and swaps parts and views without a page reload. The token sheet (theme.css) is re-read at the same time, so new token values and custom CSS appear live as well.
  • Activation and rollback re-validate the installed files; a theme that no longer validates is refused.
  • A child theme requires its parent to be installed. Parent loads first, then child.
  • If the bundle fails to load, does not call defineTheme, or its engines.contract does not match the running product, the client keeps default and logs a [theme] warning. If theme code throws while rendering, the theme is deactivated for that browser’s session and default renders in its place, without a reload.

Runtime delivery

RequestWhat is served
GET /api/v1/config/themeThe resolved configuration: active theme, parent chain, entry URL, tokens, overrides, version
GET /api/v1/config/theme.cssThe layer order, the merged token block on :root and the operator’s sanitised custom CSS
GET /api/v1/config/theme.jsA redirect to the active theme’s immutable bundle, or an empty module when default is active
GET /themes/<slug>/<version>/…The installed theme’s files, with immutable cache headers

Bundles are addressed by version, so a new version never overwrites a cached one. The entry bundle, the stylesheet and the screenshot URLs also carry the archive’s checksum (dist/theme.js?v=<16 hex>): a version that is deleted and uploaded again with different files gets new URLs, so a returning browser does not keep the old files from its year-long cache. Chunks are content-hashed by the build and need no query. Publish every change as a new version anyway: that is what players’ rollbacks and the update history rely on. The full reference is in the REST API and the WebSocket events (appearance_updated).

Updating

Uploading a newer version of an installed theme upgrades it in place: the new version becomes the installed one (and stays active if the theme was active), and the previous version is kept for rollback. The installed version and the previous version kept for rollback cannot be uploaded again (409; the Themes page shows the reason above the list); deleting the theme removes both, after which any version can be uploaded again. Operator overrides are keyed by theme slug and survive the update.

Rollback

Roll back returns to the previous version of the same theme, and the two swap places, so a second rollback goes forward again. Deactivate returns the install to default without a page reload.

Deletion

Deleting a theme removes its files, its saved settings and its seeded strings. The active theme, the built-in theme and a theme another theme extends cannot be deleted.

Export, no duplication

Export downloads the installed version as <slug>-<version>.tgz. Duplicating a theme is not offered (decision 37b): a copy needs a new slug, and the theme’s own ids and strings carry its slug (theme.<slug>.*), so a renamed copy would not validate. To fork a theme, change its slug and every theme.<slug>.* id in the source, then build and upload it.

Permissions

PermissionLevelAllows
appearance:reada1See Appearance
appearance:edita1Customise, branding, menus, custom CSS, activation
appearance:installaUpload and delete archives

A seeded Theme manager group at level a1 holds appearance:install and appearance:edit by override.

Deployment notes

  • Installed themes live in themes/<slug>/<version>/ under the server’s working directory; THEMES_DIR overrides the folder. In development that is themes/ in the root of the Poker Engine source.
  • Docker installs keep them in the themes_data volume (/app/themes), which survives upgrades. The shipped nginx config has the /themes/ location, the theme endpoint locations outside the API rate zone, and a 50 MB body limit on the upload route. See Deployment.
  • Kubernetes installs use the persistence.themes claim and must route /themes/ and /api/v1/config/theme.css|js to the app. With more than one replica the theme files must be on a ReadWriteMany volume. See Kubernetes.
Try the live demo Pricing

Have questions about Poker Engine? We reply fast.