FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
charmaine
charmaineNotion_GCal_Sync
Syncs my Google Calendar with Notion to generate meeting prep
Public
Like
1
Notion_GCal_Sync
Home
Code
5
README.md
googleCalendar.ts
C
index.ts
notion.ts
userInfo.ts
Branches
1
Pull requests
Remixes
1
History
Environment variables
7
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
4/25/2025
README.md

Calendar to Notion Meeting Prep

This val:

  1. Checks my Google Calendar every morning for upcoming user meetings
  2. Identifies meetings with external users (non-@val.town email addresses)
  3. Creates a meeting prep page in Notion for each user meeting
  4. Gathers information about the meeting participant and populates the Notion page

Setup Instructions

1. Google Calendar Setup

  1. Create a Google Cloud project at https://console.cloud.google.com/
  2. Enable the Google Calendar API
  3. Create OAuth2 credentials (client ID and client secret)
  4. Set up OAuth consent screen
  5. Use the OAuth playground (https://developers.google.com/oauthplayground/) to:
    • Authorize the Calendar API (https://www.googleapis.com/auth/calendar.readonly)
    • Exchange authorization code for tokens
    • Save the refresh token

2. Notion Setup

  1. Create a Notion integration at https://www.notion.so/my-integrations
  2. Get your Notion API key
  3. Create a database in Notion for meeting pages with these properties:
    • Title (title)
    • Meeting Date (date)
    • Attendee (rich text)
    • Email (email)
  4. Share your database with the integration
  5. Get the database ID from the URL (the part after the workspace name and before the question mark)

3. SERP API Setup (for better user information)

  1. Sign up for a SERP API account at https://serpapi.com/
  2. Get your API key
  3. Add it as an environment variable

4. Set Environment Variables in Val Town

Set the following environment variables in Val Town:

  • GOOGLE_CLIENT_ID: Your Google OAuth client ID
  • GOOGLE_CLIENT_SECRET: Your Google OAuth client secret
  • GOOGLE_REFRESH_TOKEN: Refresh token for your Google account
  • NOTION_API_KEY: Your Notion API key
  • NOTION_DATABASE_ID: ID of the Notion database where meeting pages will be created
  • TEAM_DOMAIN: Your team's email domain (e.g., "val.town")
  • SERP_API_KEY: Your SERP API key for enhanced user information

5. Set Cron Schedule

After deploying, set the cron schedule in the Val Town web UI to run every morning (e.g., "0 7 * * *" for 7 AM daily).

Project Structure

  • index.ts: Main cron job that runs daily
  • googleCalendar.ts: Functions for interacting with Google Calendar API
  • notion.ts: Functions for creating and updating Notion pages
  • userInfo.ts: Functions for gathering information about meeting participants

How It Works

  1. The cron job runs every morning
  2. It fetches your calendar events for the day
  3. It identifies meetings with exactly one external participant (not from your team domain)
  4. For each user meeting, it:
    • Gathers information about the participant using their email and SERP API
    • Creates a Notion page with meeting details and participant information
    • Adds sections for meeting notes and action items
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.