Skip to content

Commit d9fc7b0

Browse files
author
Sergei Orlov
committed
📝 Extend README
1 parent 00f5978 commit d9fc7b0

File tree

1 file changed

+72
-7
lines changed

1 file changed

+72
-7
lines changed

README.md

Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
Gatsby source plugin for working with official [Notion](https://notion.so) API.
1616

17+
Here's a [Postman](https://www.postman.com/) collection to play around with the API if you're interested: [https://www.postman.com/notionhq/workspace/notion-s-public-api-workspace/overview](https://www.postman.com/notionhq/workspace/notion-s-public-api-workspace/overview)
18+
1719
## 🚧 It's a work in progress
1820

1921
This is a source plugin for pulling content into Gatsby from official public Notion API (currently
@@ -42,10 +44,13 @@ Before using this plugin, make sure you
4244
1. Created a Notion integration (sign in to Notion, go to `Settings & Memberships``Integrations`
4345
`Develop your own integrations`,
4446
[short link to the Integrations creation section](https://www.notion.so/my-integrations)). It's
45-
OK to use an internal one. Don't forget to copy the token.
46-
2. Go to the database you want to have access to and share it with the integration (`Share` → Select
47+
OK to use an internal one. Don't forget to copy the token:
48+
![Notion integration creation GIF](https://files.readme.io/2ec137d-093ad49-create-integration.gif)
49+
2. Go to the database you want to have access to from Gatsby, and share it with the integration (`Share` → Select
4750
the integration in the `Invite` dropdown). Don't forget the database in the URL. It's a series of
48-
characters after the last slash and before the question mark. Here's a reference:
51+
characters after the last slash and before the question mark.
52+
![Notion integration sharing GIF](https://files.readme.io/0a267dd-share-database-with-integration.gif)
53+
Here's a reference:
4954
https://www.notion.so/{USER}/**{DATABASE_ID}**?{someotherirrelevantstuff}
5055
3. Then add this to your `gatsby-config.json`:
5156

@@ -85,23 +90,83 @@ query {
8590
allNotion {
8691
edges {
8792
node {
93+
title
94+
properties
95+
archived
96+
createdAt
97+
updatedAt
98+
children
8899
raw
89100
}
90101
}
91102
}
92103
}
93104
```
94105

106+
## Node properties
107+
108+
### `id`
109+
110+
Unique page identifier. This is not a Notion page identifier. You can get the Notion page id under `raw.id`.
111+
112+
### `parent` (Node)
113+
114+
Parend Node.
115+
116+
### `children`
117+
118+
Blocks that belong to the page.
119+
120+
### `title` (String)
121+
122+
Page title joined into one string.
123+
124+
### `properties`
125+
126+
Properties of the page. An object with keys representing database columns (snake-cased), and the following value:
127+
128+
#### `id` (String)
129+
130+
Notion column id
131+
132+
#### `key` (String)
133+
134+
Readable name of the column (without snake case).
135+
136+
#### `value` (\*)
137+
138+
Value of the column for the page. Might have different structure depending on the type.
139+
140+
#### `type` (String)
141+
142+
Notion type of the column.
143+
144+
### `archived` (Boolean)
145+
146+
Boolean. Is **true** if the pages was marked removed but not removed permanently.
147+
148+
### `createdAt` (Date)
149+
150+
Date of page creation.
151+
152+
### `updatedAt` (Date)
153+
154+
Date of the last page update.
155+
156+
### `raw` (\*)
157+
158+
Untouched contents of whatever Notion API returned.
159+
95160
## Current state
96161

97162
- Due to the fact that Notion API only appeared recently, and it is still in beta, some blocks are
98163
marked "unsupported". Among others, images cannot be fetched for now
99164
- Currently, `gatsby-source-notion-api` can only work with one provided database. In further
100165
releases, all databases reachable by the Integration will be available for querying
101-
- Nested blocks are currently skipped. E.g. if a list item has a nested sublist, it's contents will
102-
be omitted. This will be fixed in the nearest releases
103-
- Only raw content is available. Raw meaning whatever Notion returns. Further releases will aim at
104-
providing a more convenient data format apart from the raw one
166+
- ~~Nested blocks are currently skipped. E.g. if a list item has a nested sublist, it's contents will
167+
be omitted. This will be fixed in the nearest releases~~ Nested blocks are supported as of `0.4.0`!
168+
- ~~Only raw content is available. Raw meaning whatever Notion returns. Further releases will aim at
169+
providing a more convenient data format apart from the raw one~~ `0.3.0` features support for **archived**, **createdAt**, **updatedAt**, **properties** and **title**.
105170

106171
## 🎉 You did it
107172

0 commit comments

Comments
 (0)