You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/plugins/distributors/notion.md
+49-15Lines changed: 49 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,18 +28,10 @@ The Notion plugin works seamlessly with the Object Transform plugin to map your
28
28
"plugin": "@curatedotfun/object-transform",
29
29
"config": {
30
30
"mappings": {
31
-
"Title": {
32
-
"template": "{{title}} by {{author}}"
33
-
},
34
-
"URL": {
35
-
"field": "url"
36
-
},
37
-
"Tags": {
38
-
"field": "categories"
39
-
},
40
-
"Published": {
41
-
"field": "publishDate"
42
-
}
31
+
"title": "{{title}} by {{author}}",
32
+
"url": "{{source}}",
33
+
"tags": "[{{categories}}]",
34
+
"published": "{{createdAt}}"
43
35
}
44
36
}
45
37
},
@@ -48,14 +40,20 @@ The Notion plugin works seamlessly with the Object Transform plugin to map your
48
40
"plugin": "@curatedotfun/notion",
49
41
"config": {
50
42
"token": "your_integration_token",
51
-
"databaseId": "your_database_id"
43
+
"databaseId": "your_database_id",
44
+
"fields": {
45
+
"title": "title",
46
+
"url": "url",
47
+
"tags": "multi_select",
48
+
"published": "date"
49
+
}
52
50
}
53
51
}
54
52
]
55
53
}
56
54
```
57
55
58
-
The Notion plugin will automatically format each property based on its value type:
56
+
By default, the Notion plugin will automatically format each property based on its value type:
59
57
60
58
-**Strings** → Rich Text
61
59
-**Dates** (or date strings) → Date
@@ -64,6 +62,8 @@ The Notion plugin will automatically format each property based on its value typ
64
62
-**Arrays** → Multi-select
65
63
-**Other types** → Rich Text (converted to string)
66
64
65
+
Although you should explicitly specify the field types using the `fields` configuration option (see below).
66
+
67
67
:::tip
68
68
Design your database schema to match your transformed object structure. The plugin will create pages with properties matching your object's field names.
69
69
:::
@@ -74,13 +74,47 @@ You need to specify:
74
74
75
75
-`token`: Notion Internal Integration Token
76
76
-`databaseId`: Your database ID extracted from the URL
77
+
-`fields`: A mapping of field names to Notion property types
77
78
78
79
```json
79
80
{
80
81
"plugin": "@curatedotfun/notion",
81
82
"config": {
82
83
"token": "secret_...", // Your Notion integration token
83
-
"databaseId": "..."// Your Notion database ID
84
+
"databaseId": "...", // Your Notion database ID
85
+
"fields": {
86
+
"title": "title",
87
+
"description": "rich_text",
88
+
"date": "date",
89
+
"count": "number",
90
+
"isPublished": "checkbox",
91
+
"tags": "multi_select",
92
+
"category": "select",
93
+
"website": "url",
94
+
"email": "email",
95
+
"phone": "phone"
96
+
}
84
97
}
85
98
}
86
99
```
100
+
101
+
### Supported Property Types
102
+
103
+
The `fields` configuration allows you to explicitly specify how each field should be formatted in Notion. This gives you precise control over the data types and ensures your content is properly formatted in your Notion database.
104
+
105
+
For more information about Notion database properties, see the [Notion Database Properties documentation](https://www.notion.com/help/database-properties).
106
+
107
+
The following property types are supported:
108
+
109
+
| Property Type | Description |
110
+
|---------------|-------------|
111
+
|`title`| The main title of the page. Each page requires exactly one title property. |
112
+
|`rich_text`| Formatted text content that can include styling. |
113
+
|`date`| A date or date range value. |
114
+
|`number`| A numeric value. |
115
+
|`checkbox`| A boolean (true/false) value. |
116
+
|`multi_select`| Multiple tags or categories from a predefined list. |
117
+
|`select`| A single option from a predefined list. |
0 commit comments