directus-extension-pwa-hook
v1.0.0
Published
Progressive Web App (PWA) support for Directus admin interface with automatic meta tags, manifest.json, and service worker
Maintainers
Readme
Directus PWA Hook Extension
Adds Progressive Web App (PWA) support to your Directus admin interface. Automatically injects PWA meta tags, serves a dynamic manifest.json, and registers a service worker.
Installation
From Directus Marketplace
Set the environment variable:
MARKETPLACE_TRUST_ALL=trueInstall via Directus admin:
- Go to Settings > Marketplace
- Search for "PWA Hook"
- Click Install
Manual Installation
Copy this extension to your Directus extensions directory:
cp -r directus-extension-pwa-hook /path/to/directus/extensions/Restart Directus
Configuration
Configure in Settings > Project Settings:
- Project Name: App display name
- Project Descriptor: App description
- Project Color: Theme color (hex)
- Project Logo: App icon (auto-sized to 192x192 and 512x512)
- Public Background: Background color
Changes apply immediately without restart.
Features
- Injects PWA meta tags into admin app
- Serves
/pwa/manifest.jsondynamically from settings - Serves
/pwa/sw.jsservice worker - Auto-registers service worker on page load
- Enables "Add to Home Screen" on supported browsers
Testing
Desktop (Chrome/Edge)
- Open DevTools > Application
- Check Manifest and Service Workers tabs
- Look for install icon in address bar
Mobile
- Open admin in mobile browser
- Look for "Add to Home Screen" prompt
- Install and verify standalone mode
Offline
- DevTools > Network tab > Check "Offline"
- Refresh page - should load from cache
Important Notes
- Service worker cache doesn't do much yet - primarily provides basic offline support
- PWA installation tested only on Android and Windows 11 - other platforms may have issues
- Vibecoded with Claude Sonnet 4.5 - may have bugs or unexpected behavior
- Requires HTTPS in production (localhost works for development)
Browser Support
- Chrome/Edge: Full support
- Firefox: Full support
- Safari iOS 11.3+: Partial support
- Safari macOS: Limited manifest support
Troubleshooting
Service worker not registering?
- Check browser console for errors
- Ensure HTTPS (or localhost)
- Hard reload (Ctrl+Shift+R)
Install prompt not showing?
- Must be on HTTPS
- User must interact with site first
- Different browsers have different criteria
License
MIT
