NotionEdge

🔥
Try it out on notionedge

serverless wrapper for the private Notion API. It provides fast and easy access to your Notion content. Ideal to use Notion your CMS.

The API is designed to be hosted on lamdba@edge. You can test the api on hosted version of this project on notionedge.zoop.sh.You can also host it yourself. Lambda@Edge does not offer any free plan. Yet the cost of lambda is very nominal.

Use with caution. This is based on the private Notion API. We can not gurantee it will stay stable.

 
notion image

Features

  • 🍭 Easy to use – Receive Notion data with a single GET request
  • 🗄 Table Access – Get structured data from tables & databases
  • 🛫 CORS Friendly – Access your data where you need it
  • ✨ Easy to Extend – Add your own routes as per your needs.

Use Cases

  • Use it as a data source for blogs and documentation. Create a table with pages and additional metadata. Query the /tables endpoints every time you want to render a list of all pages.

Endpoints

Load page data

/v1/pages/<PAGE_ID>

Returns all block data for a given page. For example, you can render this data with react-notion.

notionedge.zoop.sh/v1/pages/2e22de6b770e4166be301490f6ffd420

Load data from table

/v1/tables/<PAGE_ID>

notionedge.zoop.sh/v1/tables/20720198ca7a4e1b92af0a007d3b45a4

Authentication for private pages

All public pages can be accessed without authorization. If you want to fetch private pages there are two options.

  • You can set the Authorization: Bearer <NOTION_TOKEN> header to authorize your requests.

Receiving the token

To obtain your token, login to Notion and open your DevTools and find your cookies. There should be a cookie called token_v2, which is used for the authorization.

Deployment

Deployment is done using serverless. Serverless yml exists in the project directory. You need use serverless profile to provide aws credentails / profile.

You can check out it's source GitHub.

 
Mahendra Rathod
Developer from 🇮🇳
@maddygoround

Continue reading

View all →
© 2024 Mahendra Rathod · Source