Public
Like
1
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 miliseconds.
An automated scheduler that reads posts from a Notion database and publishes them to Bluesky at scheduled times.
See it in action, https://bsky.app/profile/nucky.bsky.social
- ๐ 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
- ๐ธ Media support - Upload images with your posts (up to 4 images per post)
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
- Status (Select field) - Options: Draft, Scheduled, Posted
- URL (URL field) - Stores the Bluesky post URL after posting
- Media (Files & media field) - Upload images (JPG, PNG, GIF, WebP)
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
- Optional: Upload images to the Media field (supports JPG, PNG, GIF, WebP)
- 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