Hey @jshingler thanks for posting this issue. It's actually supported right now. Just inject unofficialNotionAPI after initializing NotionAPI yourself. Instruction is at https://github.com/NotionX/react-notion-x#private-pages.
import { NotionGraph } from "@graphcentral/notion-graph-scraper"
import fs from "fs"
import { NotionAPI } from "notion-client";
/**
* example of how to use `@graphcentral/notion-graph-scraper`
*/
;(async () => {
const notionApi = new NotionAPI({
activeUser: process.env.NOTION_ACTIVE_USER,
authToken: process.env.NOTION_TOKEN_V2
})
const notionGraph = new NotionGraph({
maxDiscoverableNodes: 2000,
maxDiscoverableNodesInOtherSpaces: 2000,
verbose: true,
unofficialNotionAPI: notionApi,
})
const graph = await notionGraph.buildGraphFromRootNode(
// Some random Japanese blog
`95fcfe03257541c5aaa21dd43bdbc381`
)
console.log(graph.nodes.length)
console.log(graph.links.length)
await new Promise((resolve, reject) => {
fs.writeFile(`test0.json`, JSON.stringify(graph), (err) => {
if (err) reject(err)
else resolve(``)
})
});
process.exit(0)
})()
Hey @jshingler thanks for posting this issue. It's actually supported right now. Just inject
unofficialNotionAPI
after initializingNotionAPI
yourself. Instruction is at https://github.com/NotionX/react-notion-x#private-pages.