OpenClawSkills
GitHub

Notion ページ

コミュニティ

Notion データベースに新しいページを作成します。

インストール

Save as `notion.js`. Requires NOTION_API_KEY and DATABASE_ID env vars.

ソースコード

JavaScript
Tutorial.terminal

// notion.js
// Creates a simple page in a Notion database

module.exports = async function(context) {
    const title = context.args.join(' ');
    const apiKey = process.env.NOTION_API_KEY;
    const dbId = process.env.DATABASE_ID;
    
    if (!apiKey || !dbId) return { error: "Missing config" };
    
    const res = await fetch('https://api.notion.com/v1/pages', {
        method: 'POST',
        headers: {
            'Authorization': `Bearer ${apiKey}`,
            'Notion-Version': '2022-06-28',
            'Content-Type': 'application/json'
        },
        body: JSON.stringify({
            parent: { database_id: dbId },
            properties: {
                Name: {
                    title: [{ text: { content: title } }]
                }
            }
        })
    });
    
    return await res.json();
};

プレビュー

● ライブデモ
Agent セッション
セッションを開始中...

使い方

  • 必要な依存関係があれば、事前にインストールします。
  • ファイルを OpenClaw のスキルフォルダ(例:~/.openclaw/skills/)に配置します。
  • エージェントを再起動するか、設定をリロードします。
  • ファイル名(拡張子なし)をツール名として呼び出すか、説明が十分なら自然言語で呼び出します。