Notion Cookbook

repository·main·Indexed 41 days ago

https://github.com/makenotion/notion-cookbook

A collection of guides, examples, and resources for building with the Notion developer platform. It includes working examples for the Notion API and Notion Workers, as well as guidance on building Notion Apps using the @notionhq/apps SDK, including workflows, database syncs, and custom blocks.

Tokens
238.5K
Snippets
640
Records
869
Agent score
51%

What's inside Notion Cookbook

  1. Overview of Sentry managed databases

    main

    The Sentry sync worker manages three distinct Notion databases to help answer reliability and health questions:

    Managed databasePurpose
    Sentry IssuesIdentifies triage priority (new, regressed, escalating, high-priority, unhandled) and highlights unassigned issues with high event volume or affected users.
    Sentry ProjectsTracks service backlogs, identifies active issues per service, monitors rising event volumes, and flags projects lacking ownership or instrumentation.
    Sentry ReleasesMonitors release health (crash-free session/user rates), detects new issues in recent rollouts, and identifies releases with insufficient data for confident assessment.

    Important Note: The worker copies metadata and aggregate sessions (issue-group, project, release metadata) but not raw events or stack traces. Sentry remains the system of record; changes made in Notion will not update Sentry.

  2. Overview of managed Zendesk databases in Notion

    main

    The Zendesk sync worker manages six specific databases in Notion to help answer support-related questions:

    Managed databasePurpose/Example Questions
    Support TicketsTracking urgent open tickets, ownership, and volume drivers.
    Zendesk OrganizationsManaging customer account tags and recent record changes.
    Zendesk UsersIdentifying agents, admins, and suspended users.
    Zendesk CSAT Survey ResponsesAnalyzing bad ratings and customer feedback.
    Zendesk Ticket MetricsMonitoring slow replies, resolutions, and handoffs.
    Zendesk SLA PoliciesReviewing first-reply and resolution targets.

    Note: These databases may contain sensitive information like ticket descriptions, organization notes, user emails, and phone numbers. Review Notion sharing settings before granting broad access.

  3. Sync closed GitHub PRs to Notion tasks

    main

    This example connects GitHub pull requests to Notion tasks. When a linked PR is closed, the script adds a comment to the corresponding Notion task detailing the outcome (merged or closed without merging). It can also optionally update a Notion Status property based on the PR outcome.

    Key Behaviors:

    • Read-only GitHub: The script reads GitHub data but does not modify pull requests or any other GitHub resources.
    • Deduplication: The script skips tasks that already have a comment from this integration to prevent duplicate comments on subsequent runs.
    • Completion: If no eligible tasks are found, the script prints Notion Tasks are already up-to-date and exits without making changes.
  4. Intercom Sync Managed Databases Overview

    main

    The Intercom sync worker manages four specific Notion databases to help answer customer-centric questions:

    Managed databaseUse Case
    CompaniesIdentify high-spend/high-usage accounts that have gone quiet; segment conversations by account.
    ContactsTrack user/lead follow-ups based on last activity; identify owners, unsubscribes, or spam flags.
    ConversationsMonitor open, unread, or priority conversations; track SLA misses, team response times, and AI escalations.
    TicketsManage unassigned or snoozed tickets; analyze queue distribution by team, type, or category.
  5. Browse available Notion API examples

    main

    The repository contains several self-contained TypeScript projects categorized by their purpose:

    Learning the API

    • Introduction to the Notion API (intro-to-notion-api/): A progressive tour of blocks, pages, databases, queries, templates, and file uploads.
    • Parse text from any block type (parse-text-from-any-block-type/): Demonstrates recursive retrieval of page content and plain text extraction from various block shapes.
    • Query large data sources (query-large-data-sources/): Shows how to bypass the 10,000-row per-query limit by splitting work into created_time windows.

    Building Integrations and Apps

    • Database email update (database-email-update/): Polling a database for status changes and sending notifications via SendGrid.
    • Generate random data (generate-random-data/): Inspecting database schemas to create correctly typed sample rows.
    • Notion–GitHub issue sync (notion-github-sync/): Syncing GitHub repository issues into a Notion database.
    • Notion task–GitHub PR sync (notion-task-github-pr-sync/): Updating Notion tasks based on GitHub pull request activity (closing/merging).
    • Web form with Express (web-form-with-express/): Using Express and browser forms to interact with Notion (creating databases, pages, blocks, and comments).
  6. Available Claude skills for Notion MCP

    main

    The following self-contained skills are available for working with Notion through Claude via the Notion MCP server:

    • Knowledge capture: Turn a conversation into a decision record, how-to guide, FAQ, or other durable workspace documentation.
    • Meeting intelligence: Gather Notion context and create a meeting pre-read and agenda.
    • Research and documentation: Find information across a workspace, synthesize it, and publish a cited report in Notion.
    • Spec to implementation: Convert a product or technical spec into an implementation plan and trackable Notion tasks.
  7. Sync GitHub Issues to a Notion Database

    main

    This integration synchronizes GitHub Issues from a specific repository into a Notion Database. It uses GitHub's Octokit library to fetch issues and the Notion API to update the database.

    Note: This is a one-way sync. Changes made to issues within the Notion database will not be reflected back in GitHub. For two-way or action-based synchronization (e.g., triggering an email when a status changes), refer to the database-email-update example.

  8. Parse plain text from any Notion block type

    main

    This integration demonstrates how to retrieve Notion page content (modeled as blocks) and extract plain text from any block type, including headers, lists, and media. It utilizes the plain_text value from the rich_text property, which is available in many block types.

    Note that not all blocks contain text (e.g., dividers) and the structure of returned blocks varies by type (e.g., paragraph blocks vs. image blocks).

  9. Explore Notion cookbook resources and developer guides

    main

    The Notion cookbook provides several specialized resources for developers building with the Notion API:

    If you want to contribute to the project, you can add or improve examples, Workers, skills, or guides via the contribution process.

  10. Overview of Notion Worker types

    main

    The cookbook provides three main patterns for Notion Workers:

    1. Sync: Maintains a managed Notion database by pulling data from an external source (e.g., GitHub, HubSpot, Salesforce).
    2. Tool: Provides a Notion Agent with a callable capability to execute repeatable workflows (e.g., querying a database, generating charts, or managing Vercel deployments).
    3. Webhook: Handles incoming events from external services (e.g., verifying and processing Zendesk webhooks).
  11. Overview of Managed Salesforce Databases

    main

    The Salesforce Sync worker manages two primary databases in Notion. The Opportunity database maintains a relationship to the Account database, allowing for relational navigation within Notion.

    Managed databasePurpose / Questions it answers
    Salesforce AccountsAnalyzes account size (revenue/headcount), distribution (owner, industry, type, country), and recent changes.
    Salesforce OpportunitiesTracks pipeline health (closing soon, stage breakdown, owner, forecast category, lead source, probability, or account association).
  12. Overview of PagerDuty managed databases

    main

    The PagerDuty sync worker manages two distinct databases in Notion to provide visibility into operations and reliability:

    1. PagerDuty Incidents: Tracks high-urgency incidents, ownership (who is handling them), affected services, escalation/urgency changes, and resolution times.
    2. PagerDuty Services: Tracks service status (awaiting response, responding, or maintenance), on-call coverage, support hours, paging urgency, and auto-resolution settings.

    Note: This is a read-only coordination view. PagerDuty remains the source of truth for paging, acknowledging, and resolving incidents.