Standalone iframe extension for Y-app. Hosts a planning grid + Financieel/Projecten/HR dashboards for KG.
This repo builds into static HTML/JS + CSS, gets deployed to GitHub Pages, and is loaded inside Y-app through the Extension Manager (a host-side iframe + postMessage bridge).
- This repo publishes to
https://<owner>.github.io/Y_App-extension-kg-planning/. - In Y-app → Settings → Extensions → Add, paste that URL.
- Y-app's Extension Manager stores the URL in the instance's SQLite row.
- When a user opens the extension, Y-app renders:
<iframe sandbox="allow-scripts allow-same-origin" src="https://…/?host=<origin>&instance=<id>&erpUrl=<url>&lang=<nl|en>" />
- The iframe calls ERPNext via
postMessage→ parent Y-app proxies the request using the user's ERPNext session. Credentials never reach the iframe.
npm install
npm run dev # http://localhost:5174
npm run build # → dist/Running outside Y-app (npm run dev directly) will get "Extension loaded
outside Y-app iframe" errors from the bridge — that's expected. To test
it end-to-end, run Y-app locally and point its Extension Manager at
http://localhost:5174/.
src/bridge.ts— the postMessage RPC. ExportsfetchList,fetchDocument,updateDocument,callMethod,getErpNextAppUrl,getActiveInstanceId. Replaces what used to be Y-app'slib/erpnext.tsandlib/instances.ts.
Everything else is pure React and doesn't know the host exists.