Home > notion-utils > getAllPagesInSpace
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>;
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>