PWA and push.
A FleekSite site can install on a phone like an app, work offline, and send push notifications. The platform serves the web app manifest and the service worker for you; your templates can override either one, and the render context carries the key you need to subscribe a visitor to push.
Installing on a phone, working offline, and push notifications are a Premium capability, switched on by the site's PWA feature. The routes below always exist; the registration script and the head tags that make a site installable are emitted when the feature is on.
The web app manifest
The platform serves a web app manifest at /manifest.json. By default it is generated from your site: the name and short name, the icons derived from your logo, the theme colour, a standalone display mode and a start URL. Every page links it from the head with .
To take control of the manifest, add a template whose permalink is manifest.json. The platform renders it as Liquid with site in scope, then parses the result as JSON, so you can drive the manifest from your site's own data:
{
"name": "{{ site.name }}",
"short_name": "{{ site.short_name }}",
"display": "standalone",
"start_url": "/",
"theme_color": "{{ site.theme }}"
}If the template does not render valid JSON, the platform falls back to the generated manifest, so a broken override never leaves the site without one.
On a site with the PWA feature on, Standard mode links the manifest once. Compat linked it twice, once in the head block and once more inside the service-worker registration; standard drops the duplicate. The full list of mode differences is on the Render modes page.
The service worker
The service worker is served at /sw.js. The platform uses your own sw.js template if you have one, otherwise a platform default, and always renders it as Liquid with site in scope. When the PWA feature is on, the platform also emits the registration script that calls navigator.serviceWorker.register('/sw.js') on load, so you do not have to register it yourself.
The matching favicon is served at /favicon.ico, taken from the site favicon, then the short logo, then the logo.
Push notifications
For push, the render context exposes vapid_public_key, the site's VAPID public key for Web Push. Print it into the script that subscribes a visitor:
{{ vapid_public_key }}The flow is the standard Web Push one: register the service worker, subscribe through the browser's pushManager with the VAPID key, then send the resulting subscription to the platform.
>The urlBase64ToUint8Array helper is the small, well-known Web Push snippet that decodes a base64url key into the byte array the browser expects. Post the subscription to /api/v1/notifications/subscribe, and remove it later with /api/v1/notifications/unsubscribe. If push is not configured for the site, vapid_public_key is an empty string, so check for that before you offer to subscribe.