import { Client } from "@notionhq/client";
import type { BlockObjectRequest } from "@notionhq/client/build/src/api-endpoints";
/**
* Learn more at
* https://developers.notion.com/reference/patch-block-children
*/
type Notion = {
token: string;
};
export async function main(
auth: Notion,
block_id: string,
children: object[] = [],
) {
const client = new Client({ auth: auth.token });
return await client.blocks.children.append({
block_id,
children: children as BlockObjectRequest,
});
}
Submitted by hugo989 7 days ago