Node.js program to periodically check (with node-cron
) a Notion Database via the Notion API,
and send a push notification via Gotify when conditions are met on the database's children.
The script specifically targets the "Home Chores Manager" template by Trishka but can easily be modified to any Notion db by changing the getTasksDueTodayOrOverdue
method.
- Notion integration added to your workspace
- Target database shared with integration user
- Gotify server installed and configured somewhere
node
>=14.15.0 installed
Navigate to the cloned repository and run yarn
or npm install
node . [options]
Options:
--token=YOUR_NOTION_SECRET # via "my integrations" page on Notion
--list=true # (optional) grab a list of database IDs using your notion token (no other parameters than --token required to run this)
--db=YOUR_DB_ID # from the list above
--gotify-url="https://my.server:port" # gotify server url
--gotify-token=YOUR_GOTIFY_TOKEN # via apps section of gotify
--cron-string="0 8-21/3 * * *" # how often to poll Notion and send notifications
# (the default is every 3rd hour between 8am and 9pm)
--notion-backlink="https://notion.so/Some-Url" # (optional) backlink to launch when Gotify notification is tapped
--no-cron=true # (optional) disable the cron scheduler and directly run a one-off poll and push
Most options have a .env
equivalent, see .env.example
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.