diff --git a/src/backend/services/homepage/PuterHomepageService.ts b/src/backend/services/homepage/PuterHomepageService.ts index 2a38744b7..9be7c0fee 100644 --- a/src/backend/services/homepage/PuterHomepageService.ts +++ b/src/backend/services/homepage/PuterHomepageService.ts @@ -185,6 +185,10 @@ export class PuterHomepageService extends PuterService { app_origin: this.#originFromRequest(req), gui_origin: this.#originFromRequest(req), hosting_domain: this.config.static_hosting_domain, + // The GUI loads the SDK itself in bundled mode, so it needs this + // to serve its own build rather than the public CDN. + puterjs_bundle: + this.config.gui_puterjs_bundle ?? 'https://js.puter.com/v2/', asset_dir: assetDir, captchaRequired, ...meta, diff --git a/src/gui/src/index.js b/src/gui/src/index.js index f39473dbf..f0f4a5cfd 100644 --- a/src/gui/src/index.js +++ b/src/gui/src/index.js @@ -75,7 +75,7 @@ window.gui = async (options) => { else if ( window.gui_env === 'prod' ) { // This stuff is now handled in the backend in PuterHomepageService - await window.loadScript('https://js.puter.com/v2/'); + await window.loadScript(options.puterjs_bundle ?? 'https://js.puter.com/v2/'); // Load the minified bundles // await window.loadCSS('/dist/bundle.min.css'); }