NotionReader
Defined in: packages/readers/src/notion.ts:15
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
BaseReader
<Document
>
Constructors
Constructor
new NotionReader(
options
):NotionReader
Defined in: packages/readers/src/notion.ts:22
Constructor for the NotionReader class
Parameters
options
NotionReaderOptions
Configuration options for the reader
Returns
NotionReader
Methods
toDocuments()
toDocuments(
pages
):Document
<Metadata
>[]
Defined in: packages/readers/src/notion.ts:31
Converts Pages to an array of Document objects
Parameters
pages
Page
[]
The Notion pages to convert (Return value of loadPages
)
Returns
Document
<Metadata
>[]
An array of Document objects
loadPages()
loadPages(
rootPageId
):Promise
<Page
[]>
Defined in: packages/readers/src/notion.ts:47
Loads recursively the Notion page with the specified root page ID.
Parameters
rootPageId
string
The root Notion page ID
Returns
Promise
<Page
[]>
A Promise that resolves to a Pages object(Convertible with the toDocuments
method)
loadData()
loadData(
rootPageId
):Promise
<Document
<Metadata
>[]>
Defined in: packages/readers/src/notion.ts:67
Loads recursively Notion pages and converts them to an array of Document objects
Parameters
rootPageId
string
The root Notion page ID
Returns
Promise
<Document
<Metadata
>[]>
A Promise that resolves to an array of Document objects
Implementation of
BaseReader.loadData