Public
Like
2
notion-2-bluesky
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v22View latest version
An automated scheduler that reads posts from a Notion database and publishes them to Bluesky at scheduled times.
- π Schedule Bluesky posts from Notion database
- π€ Automatic posting via cron job (every 15 minutes)
- π Status tracking (Draft β Scheduled β Posted)
- π Stores posted URLs back to Notion
Your database needs these fields:
- Title (Title field) - Post title/identifier
- Text (Rich Text field) - The post content
- Scheduled Date (Date field with time) - When to post β οΈ ADD THIS FIELD
- Status (Select field) - Options: Draft, Scheduled, Posted
- URL (URL field) - Stores the Bluesky post URL after posting
Set these in your Val Town environment:
NOTION_TOKEN- Your Notion integration tokenNOTION_DATABASE_ID- Your database IDBLUESKY_HANDLE- Your Bluesky handle (e.g., user.bsky.social)BLUESKY_APP_PASSWORD- Your Bluesky app password
Make sure your Notion integration has access to:
- Read content
- Update content
- Read database structure
/scheduler.ts- Main cron job that checks and posts/lib/notion.ts- Notion API integration/lib/bluesky.ts- Bluesky posting functionality/lib/types.ts- TypeScript interfaces
- Cron job runs every 15 minutes
- Queries Notion for posts with status "Scheduled" and due date/time
- Posts to Bluesky
- Updates Notion record with "Posted" status and Bluesky URL
- Create a new row in your Notion database
- Set the Text field with your post content
- Set the Scheduled Date field with when you want it posted
- Set Status to "Scheduled"
- The cron job will automatically post it at the scheduled time