This page tells you what a theme is allowed to do, what you need before you start, and what the work looks like from an empty folder to an installed archive.
What a theme can do
- Set the colours, fonts, spacing and artwork of every player-facing surface through tokens.
- Replace whole screens by registering a template for a view id, with
defaultas the fallback for every screen it does not provide. - Fill the header, footer, navigation, logo, sidebars and other part areas with its own parts.
- Define section types that operators compose into pages and sidebars, and ship default section lists.
- Skin the poker table: set
--tbl-*tokens and style the standard layout through its DOM contract. Or draw your own table layout from a read-only view of the game, within the timing ranges the product sets; it reaches live tables once it is certified or an admin enables it (see Testing and Certification). - Expose settings that operators edit in Site & Content › Customise, and ship translatable strings.
What a theme cannot do
- Talk to the server. A theme has no socket, no
fetchand no storage; it reads data through the SDK only. - Inject HTML.
innerHTML,dangerouslySetInnerHTML,document.writeand script or style elements are rejected; rich text goes through the SDK’sRichText, which sanitises it. - Change gameplay: action legality, amounts, timers, showdown, chat delivery and everything else on the product side of the gameplay boundary.
- Touch the admin panel. The admin surface is pinned to its own palette (light by default, dark when an admin switches to it) and never receives theme tokens.
- Bundle third-party libraries. The scanner rejects minified or obfuscated code; themes use React, the SDK and plain source.
- Add routes. Routes stay host-owned; a theme provides templates for the screens that exist.
Prerequisites
- The theme tools from My Account on onlinepokerscript.com: the theme CLI and the sample themes.
- The Poker Engine source with its dependencies installed (
npm ci). The theme CLI uses the product’s own validator and contract from the source, so it runs from the root of the source asnpm run theme -- <command> [options] <theme-dir>; the theme folder itself can be anywhere and needs nonode_modules. - Node.js 22.15 or later and npm 10, the versions the product uses. The CLI pins its build tools (Vite, Tailwind) to the product’s versions.
- A local product to install into: the database migrated and seeded,
npm run devandnpm run dev:clientrunning. The tutorial sets one up step by step.
The theme tools are not published to npm. A theme is built against a contract version, and npm run themes:export-contract -- --out <dir> writes that contract (types, SDK declarations, manifest schema, validator, token list, DOM contract, tag dictionary) as a snapshot for your own tooling.
The shape of the work
- Start from
default. Most themes are child themes:extends: "default"in the manifest, then override only what you need. A child theme may itself be extended once; two levels is the limit. - Decide what you change. Tokens only, a few parts, a section type, a table layout, or a whole set of templates. Each page in this guide set covers one of those.
- Build and validate locally. The CLI builds the archive and runs the same validator the server runs on upload. See Building and Packaging.
- Test. Run it against your local product with
theme dev, then through upload and activation. A table layout mounts on live tables once it is certified or an admin enables it. See Testing and Certification. - Install. Upload the archive in Site & Content › Themes, preview it, activate it. See Installing and Updating.
The tutorial walks through all five steps with the sample-parts child theme.
Where things live
| Thing | Location |
|---|---|
| The contract (types, schemas, validator, DOM contract, tag dictionary) | packages/shared/src/themes/ and src/themes/; described in Theme Contract; exported with npm run themes:export-contract; a theme pins its version with engines.contract |
| The theme CLI | The theme tools from My Account |
The built-in theme default | client/src/themes/default/, compiled with the client; never uploaded |
Sample child themes, one capability each; the tutorial builds sample-parts | The theme tools from My Account; they are examples, not product themes |
| Installed themes at runtime | themes/<slug>/<version>/ under the server’s working directory in development, the themes_data volume (/app/themes) in production; THEMES_DIR overrides it |
Next
Anatomy of a Theme describes the source tree, the archive and the manifest.