class NotionAPILoaderA class that extends the BaseDocumentLoader class. It represents a document loader for loading documents from Notion using the Notion API.
const pageLoader = new NotionAPILoader({
clientOptions: { auth: "<NOTION_INTEGRATION_TOKEN>" },
id: "<PAGE_ID>",
type: "page",
});
const pageDocs = await pageLoader.load();
const splitDocs = await splitter.splitDocuments(pageDocs);
const dbLoader = new NotionAPILoader({
clientOptions: { auth: "<NOTION_INTEGRATION_TOKEN>" },
id: "<DATABASE_ID>",
type: "database",
propertiesAsHeader: true,
});
const dbDocs = await dbLoader.load();