Skip to content

JaeSeoKim/nextjs-notion-api-example

Repository files navigation

Notion API ❤️ Next.js example!

This is a collection of React, Next.js usage examples by notion-api written with typescript.

I'm still writing various examples, so if you find a problem, please leave an issue!

Pages

Index

rendering NOTION_INDEX_PAGE with SSG

/pages/[page_id]

rendering notion page for [page_id] with SSG

API

/api/pages/[page_id]

  • GET

  • success - 200 :

    {
      "page": Page // https://developers.notion.com/reference/page;
    }
  • error - 500 :

    {
      "page": null,
      "error": string,
      "code": ClientErrorCode | APIErrorCode,
    }

/api/databases/[database_id]

  • GET

  • success - 200 :

    {
      "database": Database // https://developers.notion.com/reference/get-database;
    }
  • error - 500 :

    {
      "database": null,
      "error": string,
      "code": ClientErrorCode | APIErrorCode,
    }

/api/databases/[database_id]/pages

  • GET

  • query

    • start_cursor?: string;
    • page_size?: string;
  • success - 200 :

    {
      "pages": Page[] // https://developers.notion.com/reference/page;
    }
  • error - 500 :

    {
      "pages": null,
      "error": string,
      "code": ClientErrorCode | APIErrorCode,
    }

Components

RichText

Props

  • value : RichText

Block

Props

  • value : Block

About

Notion-Api with NextJs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published