Customer Portal & Storefront
Packages ships both a turnkey Customer Portal (/portal/*) and a Storefront PHP API so your public marketing pages, pricing tables, and documentation pages stay synchronized with your package catalog.
Customer Portal (/portal/*)
Section titled “Customer Portal (/portal/*)”| Route | Purpose |
|---|---|
/portal/dashboard |
Lists all active licenses, downloadable packages, latest versions, and update expiry dates. |
/portal/package/{slug} |
Displays release history, changelogs, versioned ZIP + .sha256 downloads, Composer install instructions, and active domain activations. |
/portal/billing |
Shows billing ledger entries, renewal actions, and Payments invoices/portal links when integrated. |
/portal/tokens |
Lets customers create, copy once, and revoke pkg_tok_... Composer v2 credentials. |
POST /portal/action/* |
CSRF-protected self-service actions (create/revoke Composer token, deactivate a domain slot, trigger renewal checkout). |
POST /portal/logout |
Signs out cleanly and clears browser history state via Inertia::clearHistory(true). |
Portal History & Cache Hardening
Section titled “Portal History & Cache Hardening”Every authenticated /portal/* response enables encryptHistory(true) and emits Cache-Control: private, no-store, max-age=0 headers so sensitive license keys and download tokens are never cached by shared proxies or visible via the browser Back button after logout.
Storefront PHP API & Page Bindings
Section titled “Storefront PHP API & Page Bindings”Bind packages and bundles to native ProcessWire pages via unique 1:1 product_page_id fields and documentation page references, then query them directly from your site/templates/*.php files:
<?php namespace ProcessWire;
$packages = Packages::requireInstance($wire);
// Browse public catalog or fetch one package by slug$catalog = $packages->catalog();$bookingKit = $packages->package('booking-kit');
// Check what the signed-in customer already owns$access = $packages->userPackageAccess($user, 'booking-kit');
// Resolve packages or bundles bound to the current ProcessWire product or docs page$productPkg = $packages->packageForPage($page);$productBundle = $packages->bundleForPage($page);
$docPkg = $packages->packageForDocsPage($page);$docPkgs = $packages->packagesForDocsPage($page);$docBundle = $packages->bundleForDocsPage($page);$docBundles = $packages->bundlesForDocsPage($page);