Notion CMS Setup Guide

    Step 1: Create or Use an Existing Notion Integration
    You need to create a Notion integration if you haven't already done so.
    1. Go to Notion Integrations page
    2. Click on "+ New integration"
    3. Give it a name like "AFA Website Integration"
    4. Select the workspace where your content will live
    5. Click "Submit" to create your integration
    6. Copy your "Internal Integration Secret" (it starts with 'secret_')
    Step 2: Create a New Notion Page
    Create a dedicated page in Notion for your website content.
    1. Go to your Notion workspace
    2. Create a new page (e.g., "Arthur Francis Website Content")
    3. Copy the URL of this page from your browser's address bar
    4. The URL should look like: https://www.notion.so/workspace/Your-Page-e71d8f28xxxxx...
    Step 3: Share Your Page with the Integration
    This is the most important step. Your page must be connected to your integration.
    1. Open your Notion page
    2. Click the "..." menu in the top-right corner
    3. Go to "Add connections"
    4. Select your integration ("AFA Website Integration") from the list
    5. The integration now has permission to access this page

    Important note about page sharing

    The error message indicates that your integration can't find the Notion block with ID starting with "e71d..." This often happens when the page exists but hasn't been shared with your integration. Make sure to complete Step 3 carefully.

    Step 4: Update Environment Variables
    Make sure your environment has the correct Notion credentials.

    You need to set these environment variables in your Replit Secrets:

    NOTION_INTEGRATION_SECRET
    NOTION_PAGE_URL

    Make sure the NOTION_PAGE_URL is the complete URL of your Notion page.

    Step 5: Run the CMS Setup
    After completing all the steps above, run the setup script.

    Our setup script will create all necessary databases in your Notion page. You can run it from the API endpoint:

    POST /api/cms/setup