janniks / vue-notion

A fast Vue renderer for Notion pages
https://vue-notion.now.sh
Other
883 stars 65 forks source link

Migrate to notion public API #32

Open pi0 opened 3 years ago

pi0 commented 3 years ago

Hi @janniks. Thanks for all the awesome efforts you put into this package and nuxt support.

If you've followed notion news (tweet) there is now a public API and notion-sdk-js (pending for universal support https://github.com/makenotion/notion-sdk-js/issues/38). I'm wondering how is your timing and take on this. And if needed any help would be more than happy to work on a PR.

janniks commented 3 years ago

Yes, definitely up for it (happy to take PRs as well). It was always the plan to work with the official APIs at some point.

Although I will also check what react-notion is doing regarding this — it's nice to copy from "upstream".

janniks commented 3 years ago

The current beta API from differs a lot form the splitbee notion-api-worker. This is likely a longer issue.

If anybody wants to tackle this issue — hit me up!

xianbinKit commented 3 years ago

@janniks hello

I really want to use Notion official API with vue-notion, I have less experience, but I want to try. where you are in this subject ? can we talk ?

janniks commented 3 years ago

Hi, sure! I don't really know anything about the new API. I looked at the rough structure, and it looked very different from the splitbee/notion-api-worker — that's when I gave up 😅

It would start with retrieving the (child) blocks of a page (which is also a ~block). Then use this as a replacement for vue-notion blockMap. And then changes have to be made everywhere, where the unofficial blockMap differs from the block children response of the official API.

xianbinKit commented 3 years ago

Hi @janniks

I make a test on top of Vue Notion.

the test code is here : https://github.com/xianbinKit/vue-notion

to do a test :

export NOTION_SECRET=YOUR_NOTIOIN_SECRET_KEY;npm run notionServer

the demo json result is here : https://github.com/xianbinKit/vue-notion/blob/main/notionServer/demoPage.json

and the Notion Page is here : https://wishcompta.notion.site/Public-Test-Notion-Page-36baad2799494b13aa09f7d2a66b2561

I Tried to make changes for Vue Notion, but it seems to take much time.....So I can't make NotionRenderer work.

the demo json result is more Notion-type-like structure, do you think you can change Vue Notion for this structure json ? it takes many days ?

Thank you

basic structure :


const page =  {
   id: ....
   blocks: [ // child blocks
        {  // 1st child block
             id: ...
             blocks: // child of 1st child block
        }
   ]
}
janniks commented 3 years ago

Hi 👋🏻 Thanks for the testing. Unfortunately, the public API does not yet support as much as the private API. It will take a while to implement this — sorry

aromeronavia commented 2 years ago

What I see is that the Public API is more focused on integrations around workflows (when Notion database item is created, do some work in This other platform). I do think using the private API is more useful for this use case

ebanDev commented 11 months ago

Hi there ! It's been more than a year, anything new about the public API usage ? :) I think that would be a really interesting feature