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