vue-notion icon indicating copy to clipboard operation
vue-notion copied to clipboard

Migrate to notion public API

Open pi0 opened this issue 4 years ago • 8 comments

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.

pi0 avatar May 13 '21 19:05 pi0

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 avatar May 13 '21 19:05 janniks

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!

janniks avatar Jul 21 '21 10:07 janniks

@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 ?

xianbinKit avatar Aug 04 '21 10:08 xianbinKit

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.

janniks avatar Aug 04 '21 10:08 janniks

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
        }
   ]
}


xianbinKit avatar Aug 07 '21 20:08 xianbinKit

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

janniks avatar Oct 14 '21 19:10 janniks

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

aromeronavia avatar May 23 '22 19:05 aromeronavia

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

ebanDev avatar Nov 28 '23 16:11 ebanDev