Gatsby Source Notion Api screenshot

Gatsby Source Notion Api

Author Avatar Theme by Orlowdev
Updated: 30 Jul 2022
61 Stars

Gatsby plugin for Notion API

Categories

Overview

This article is a product analysis of a source plugin called “gatsby-source-notion-api”. The plugin allows users to pull content from the official Notion API into Gatsby and query Notion pages using GraphQL. The article provides information on features, installation instructions, and querying options.

Features

  • Get Notion pages in Gatsby via GraphQL
  • Convenient access to page properties
  • Page contents in Markdown
  • Normalized page title
  • Styling represented in Markdown (bold, italic, strikethrough, underline, code, color)
  • Access to raw data returned by Notion API
  • Support for markdown-remark and mdx

Installation

  1. Create a Notion integration and copy the integration token.
  2. Share the desired Notion database with the integration.
  3. Retrieve the database ID from the database URL.
  4. Add the following configuration options to your gatsby-config.json file:
{
  "plugins": [
    {
      "resolve": "gatsby-source-notion-api",
      "options": {
        "token": "YOUR_INTEGRATION_TOKEN",
        "databaseId": "YOUR_DATABASE_ID"
      }
    }
  ]
}

Summary

The “gatsby-source-notion-api” plugin is a useful tool for integrating Notion content into Gatsby websites. It offers features such as querying Notion pages with GraphQL, accessing page properties, converting page contents to Markdown, and providing raw Notion API data. The installation process requires creating a Notion integration and sharing the desired database with the integration. Overall, this plugin simplifies the process of incorporating Notion content into Gatsby projects.