Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.36 KB

notion-utils.getallpagesinspace.md

File metadata and controls

34 lines (22 loc) · 1.36 KB

Home > notion-utils > getAllPagesInSpace

getAllPagesInSpace() function

Performs a traversal over a given Notion workspace starting from a seed page.

Returns a map containing all of the pages that are reachable from the seed page in the space.

If rootSpaceId is not defined, the space ID of the root page will be used to scope traversal.

Signature:

export declare function getAllPagesInSpace(rootPageId: string, rootSpaceId: string | undefined, getPage: (pageId: string) => Promise<ExtendedRecordMap>, { concurrency, traverseCollections }?: {
    concurrency?: number;
    traverseCollections?: boolean;
}): Promise<PageMap>;

Parameters

Parameter Type Description
rootPageId string Page ID to start from.
rootSpaceId string | undefined Space ID to scope traversal.
getPage (pageId: string) => Promise<ExtendedRecordMap> Function used to fetch a single page.
{ concurrency, traverseCollections } { concurrency?: number; traverseCollections?: boolean; }

Returns:

Promise<PageMap>