Class: NotionReader
Notion pages are retrieved recursively and converted to Document objects. Notion Database can also be loaded, and the serialization method can be customized.
[Note] To use this reader, must be created the Notion integration must be created in advance Please refer to this document for details.
Implements
Constructors
constructor
• new NotionReader(options
)
Constructor for the NotionReader class
Parameters
Name | Type | Description |
---|---|---|
options | NotionReaderOptions | Configuration options for the reader |
Defined in
packages/core/src/readers/NotionReader.ts:33
Properties
crawl
• Private
crawl: (rootPageId
: string
) => Promise
<Pages
>
Type declaration
▸ (rootPageId
): Promise
<Pages
>
Parameters
Name | Type |
---|---|
rootPageId | string |
Returns
Promise
<Pages
>
Defined in
packages/core/src/readers/NotionReader.ts:27
Methods
loadData
▸ loadData(rootPageId
): Promise
<Document
<Metadata
>[]>
Loads recursively Notion pages and converts them to an array of Document objects
Parameters
Name | Type | Description |
---|---|---|
rootPageId | string | The root Notion page ID |
Returns
A Promise that resolves to an array of Document objects
Implementation of
Defined in
packages/core/src/readers/NotionReader.ts:63
loadPages
▸ loadPages(rootPageId
): Promise
<Pages
>
Loads recursively the Notion page with the specified root page ID.
Parameters
Name | Type | Description |
---|---|---|
rootPageId | string | The root Notion page ID |
Returns
Promise
<Pages
>
A Promise that resolves to a Pages object(Convertible with the toDocuments
method)
Defined in
packages/core/src/readers/NotionReader.ts:54
toDocuments
▸ toDocuments(pages
): Document
<Metadata
>[]
Converts Pages to an array of Document objects
Parameters
Name | Type | Description |
---|---|---|
pages | Pages | The Notion pages to convert (Return value of loadPages ) |
Returns
An array of Document objects