Package Exports
- notion-db-notification-store-file
- notion-db-notification-store-file/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (notion-db-notification-store-file) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
notion-db-notification
This cli tool is that notify created or updated page of notion database.
When you run the CLI tool, it will notify you of changes since the last time you ran it.
Usage
Install
npm install -g notion-db-notification-cli
Setup
Create config file:
scheme: 'v0'
notion:
token: 'notion_token' # your notion token
interval: 1000
store:
type: 'file'
path: 'path' # path of cli tool's state file
senders:
- type: 'slack'
token: 'slack_token' # your slack token, required scope is chat:write
channels:
- name: 'name' # channel name
slack_id: 'slack_id' # your slack channel id
sources:
- database: 'database_id' # your notion database id
channel: 'channel_name' # channel nameInitialization
notion-db-notification {config_yml_file_to_path} -i
Running
notion-db-notification {config_yml_file_to_path}
if you want to dry-run: you can use -d optionnotion-db-notification {config_yml_file_to_path} -d
Advanced
Secure token
if you avoid to write token to config file, you can use environment variable.
notion:
token: 'env:NOTION_TOKEN' # environment variable name is NOTION_TOKEN
interval: 1000senders:
- type: 'slack'
token: 'env:SLACK_TOKEN' # environment variable name is SLACK_TOKENRatelimit for Notion API
Notion API has Rate limits.
ref: https://developers.notion.com/reference/request-limits#rate-limits
So, this tool can be set interval milli seconds for api call.
notion:
token: 'notion_token' # your notion token
interval: 1000 # recommend range of 500~1500Recipe
Notify empty title page
config file:
sources:
- database: 'database_id' # your notion database id
channel: 'channel_name' # channel name
filter: 'page.properties["YOUR_TITLE_PROPERTY_NAME"].title.length == 0' # replace YOUR_TITLE_PROPERTY_NAMEDevelopment
- install:
npm install - add package:
npm init -w packages/xxx- add manually reference at package.json
- change properties at new package.json
- add reference root tsconfig.json
npm run reference- add
npm run copy:xxxcommand - change
.github/bump.yml
- publish:
npm publish --access public --workspaces
License
This repository is under MIT License
including libraries:
- makenotion/notion-sdk-js, published by MIT License
- nodeca/js-yaml, published by MIT License
- slackapi/node-slack-sdk, published by MIT License