Skip to content

Define a strategy to migrate to the official notion API #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
softlion opened this issue Jun 20, 2021 · 4 comments
Closed

Define a strategy to migrate to the official notion API #2

softlion opened this issue Jun 20, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@softlion
Copy link
Owner

softlion commented Jun 20, 2021

Define a strategy to migrate to the official notion API:

  • keeping the unofficial API functional
  • retaining most functionalities
  • avoid duplicating existing codes.
  • take the fastest and simplest path

Authentication can't be done in code. It only relies on a bearer token - an Authorize header transmitted with each request. Get a token using your notion account.

Path 1: TDD

Operation 1 - Create unit tests

  • to get a specific root page given its name
  • to get all blocks of a page, including all it's children pages, using pagination where necessary
  • to process all blocks into html, using most of the existing code

Recreate a new block model if necessary.
In a new specific nuget.

Bonus:

  • use a // pipeline (or reactivex) for ultra fast block to html transcoding

After op1 is finished, the API surface should be at least the same as the "old" nuget.

Operation 2 - Upgrade the blazor templates

  • Use the new nuget from op1
  • Simplify the authentication option model (use only the bearer token)
  • publish changes

Bonus:

  • add notion's data change detection (and trigger UI update)
@softlion softlion added the enhancement New feature or request label Jun 20, 2021
@softlion softlion self-assigned this Jun 20, 2021
@softlion softlion pinned this issue Jun 20, 2021
@softlion
Copy link
Owner Author

Operation 1 done except create/update (up for grabs)

@gmarokov
Copy link

gmarokov commented Jul 5, 2021

Hey @softlion. I had a chance to look at the Authentication. Looks like for internal integrations, Notion provide a static API key which is used as a bearer token during authentication. I haven't looked at the OAuth yet.

@softlion
Copy link
Owner Author

softlion commented Jul 5, 2021

The bearer auth have been implemented.

@softlion
Copy link
Owner Author

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants