@@ -201,6 +201,9 @@ export type GitBookSiteContext = GitBookSpaceContext & {
201201 /** Whether the request included a visitor token. */
202202 isLoggedInVisitor : boolean ;
203203
204+ /** Whether the site is rendered from a preview URL. */
205+ preview : boolean ;
206+
204207 /** Whether to display agent instructions in the markdown output. Defaults to true when undefined. */
205208 displayAgentInstructions ?: boolean ;
206209
@@ -287,6 +290,7 @@ export async function fetchSiteContextByURLLookup(
287290 isFallback : data . isFallback ?? false ,
288291 noIndexSearch : data . noIndexSearch ?? false ,
289292 isLoggedInVisitor : data . isLoggedInVisitor ?? false ,
293+ preview : data . preview ?? false ,
290294 displayAgentInstructions : data . displayAgentInstructions ,
291295 isAiAgent : data . isAiAgent ,
292296 } ) ;
@@ -310,6 +314,7 @@ export async function fetchSiteContextByIds(
310314 isFallback : boolean ;
311315 noIndexSearch : boolean ;
312316 isLoggedInVisitor : boolean ;
317+ preview : boolean ;
313318 displayAgentInstructions ?: boolean ;
314319 isAiAgent ?: boolean ;
315320 }
@@ -439,6 +444,7 @@ export async function fetchSiteContextByIds(
439444 isFallback : ids . isFallback ,
440445 noIndexSearch : ids . noIndexSearch ,
441446 isLoggedInVisitor : ids . isLoggedInVisitor ,
447+ preview : ids . preview ,
442448 displayAgentInstructions : ids . displayAgentInstructions ,
443449 isAiAgent : ids . isAiAgent ,
444450 } ;
0 commit comments