Skip to main content

📝 Notion Plugin

The Notion plugin enables distribution of content to a Notion database. It accepts any object structure and automatically formats the values based on their types to match Notion's property formats.

🔧 Setup Guide

  1. Create a Notion integration:

  2. Create and share a database:

    • Create a new database in Notion
    • Share it with your integration via the "..." menu → "Add connections"
    • Copy the database ID from the URL (the <long_hash_1> in https://www.notion.so/<long_hash_1>?v=<long_hash_2>)

📝 Usage with Object Transform

The Notion plugin works seamlessly with the Object Transform plugin to map your data into the desired structure. For example:

{
"transform": {
"plugin": "@curatedotfun/object-transform",
"config": {
"mappings": {
"title": "{{title}} by {{author}}",
"url": "{{source}}",
"tags": "[{{categories}}]",
"published": "{{createdAt}}"
}
}
},
"distribute": [
{
"plugin": "@curatedotfun/notion",
"config": {
"token": "your_integration_token",
"databaseId": "your_database_id",
"fields": {
"title": "title",
"url": "url",
"tags": "multi_select",
"published": "date"
}
}
}
]
}

By default, the Notion plugin will automatically format each property based on its value type:

  • Strings → Rich Text
  • Dates (or date strings) → Date
  • Numbers → Number
  • Booleans → Checkbox
  • Arrays → Multi-select
  • Other types → Rich Text (converted to string)

Although you should explicitly specify the field types using the fields configuration option (see below).

tip

Design your database schema to match your transformed object structure. The plugin will create pages with properties matching your object's field names.

📝 Configuration Reference

You need to specify:

  • token: Notion Internal Integration Token
  • databaseId: Your database ID extracted from the URL
  • fields: A mapping of field names to Notion property types
{
"plugin": "@curatedotfun/notion",
"config": {
"token": "secret_...", // Your Notion integration token
"databaseId": "...", // Your Notion database ID
"fields": {
"title": "title",
"description": "rich_text",
"date": "date",
"count": "number",
"isPublished": "checkbox",
"tags": "multi_select",
"category": "select",
"website": "url",
"email": "email",
"phone": "phone"
}
}
}

Supported Property Types

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.

For more information about Notion database properties, see the Notion Database Properties documentation.

The following property types are supported:

Property TypeDescription
titleThe main title of the page. Each page requires exactly one title property.
rich_textFormatted text content that can include styling.
dateA date or date range value.
numberA numeric value.
checkboxA boolean (true/false) value.
multi_selectMultiple tags or categories from a predefined list.
selectA single option from a predefined list.
urlA web address link.
emailAn email address.
phoneA phone number.