From 17b597deff1a3f2581626d15e8d185a7f8f15f42 Mon Sep 17 00:00:00 2001 From: Tim Trautmann Date: Fri, 29 May 2026 11:52:07 -0700 Subject: [PATCH] ghost: use client.site.read() instead of client.settings.browse() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The @tryghost/admin-api lib exposes site metadata as client.site.read() hitting GET /ghost/api/admin/site/. There's no client.settings.browse; the wizard's fetchSettings call was throwing 'Cannot read properties of undefined (reading browse)' on every new-site setup. /site/ returns title, description, icon, accent_color — same fields we need. --- src/lib/ghost.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/ghost.ts b/src/lib/ghost.ts index f70cd6f..f7ef609 100644 --- a/src/lib/ghost.ts +++ b/src/lib/ghost.ts @@ -70,7 +70,10 @@ function makeAdHocClient(creds: LiveCreds): any { export async function fetchSettings(creds: LiveCreds): Promise { const client = makeAdHocClient(creds); - const raw = await client.settings.browse(); + // @tryghost/admin-api exposes site metadata via client.site.read() — not + // client.settings.browse() (which doesn't exist). The /site/ endpoint + // returns title, description, icon, accent_color, etc. + const raw = await client.site.read(); const iconUrl = (() => { if (!raw?.icon) return null; const url = String(raw.icon); -- 2.51.2