β Notion Website Integration Complete
Your Next.js project is ready to fetch and display Notion database content!
π What Was Created
Core Files
src/lib/notion.ts- Notion API client & database fetchersrc/components/NotionPageGrid.tsx- React component to display Notion pagessrc/app/page.tsx- Home page (fetches & renders Notion data)
Configuration
.env.local.example- Environment variables templateREADME_NOTION.md- Detailed setup & deployment guidesetup.sh- Quick start script
π Quick Start
Step 1: Get Notion Credentials
- Go to Notion Integrations
- Click Create new integration
- Name it βPatttternsβ
- Copy the Internal Integration Token
- Go to your database β Share β add the integration
- Copy the Database ID from the URL (long alphanumeric string)
Step 2: Configure Environment
Create .env.local:
NOTION_API_KEY=xxx_your_token_xxx
NOTION_HOMEPAGE_ID=xxx_your_db_id_xxx
Step 3: Run Locally
npm run dev
Visit: http://localhost:3000
π How It Works
- Server-side fetching - Your API key stays on the server
- Data from Notion - Fetches all pages from your database
- React rendering - Displays as HTML cards with Tailwind CSS
- ISR ready - Can be set up with webhooks for auto-updates
π¨ Customization
Edit src/components/NotionPageGrid.tsx to:
- Change the grid layout
- Add more Notion property displays
- Modify styling with Tailwind classes
- Add filters/search
π Deploy to Netlify
- Push code to GitHub
- Connect repo to Netlify
- Add env variables in Netlify settings
- Deploy!
π Notion Properties Supported
Currently displays:
- Rich text
- Select/Multi-select
- URL
- Numbers
To add more property types, edit the PropertyRow function in NotionPageGrid.tsx
π Next Features to Add
- Single page view
- Search & filtering
- Image galleries
- Webhook auto-revalidation
- Markdown rendering
- Categories/tags
β Troubleshooting
βNo pages foundβ?
- Check NOTION_API_KEY is correct
- Check NOTION_HOMEPAGE_ID is correct
- Verify database is shared with integration
Build fails?
- Run
npm installagain - Check for TypeScript errors:
npm run build
API errors?
- Check Notion integration token expiry
- Verify database permissions
Ready to launch! π
Table of contents
- GuΓa de Deployment
- Auth Setup β Supabase OAuth (Static Export)
- DB Setup β Supabase
- Customization Guide
- Notion Content Refresh β Setup Guide
- Cache Pipeline
- Initial Notion Setup
- Login Flow
- Netlify-Vercel Migration Summary (REVERTED)
- E2E Deploy Checklist
- Notion Implementation Complete
- Sitemap & SEO Configuration