Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Generate random data in Notion

Create schema-aware sample pages, read them back, and try common database filters with the Notion API.

Caution

Every run creates 10 pages in the first database the integration can access. The script does not ask you to choose a database. Share the integration with only a test database that you are comfortable modifying.

Quickstart

  1. Duplicate the example database into your workspace.

  2. Create a Notion integration in the integrations dashboard, then connect it only to the duplicated test database.

  3. From the repository root, install and configure the example:

    cd examples/generate-random-data
    npm install
    cp example.env .env

    Set your integration secret in .env:

    NOTION_KEY=<your-notion-api-key>
  4. Run it:

    npm run ts-run

The script creates 10 pages with values matched to the database schema. It then reads the new pages, prints their properties, and runs example select and rich-text filters. Use the provided database template if you want the complete flow; a custom database needs both select and rich-text properties for the filter examples.

Running the command again creates 10 more pages. The script does not remove the sample data.