Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Configuration files

DerLev edited this page Jun 6, 2022 · 4 revisions

.env

GOOGLE_CID = Google OAuth2 Client ID
GOOGLE_CS = Google OAuth2 Client Secret
GOOGLE_ACCOUNT_REFRESH_TOKEN = Google OAuth2 Refresh Token for your account
TZ = Timezone (e.g. Europe/Berlin)
NOTION_TOKEN = Notion Integration Secret
SYNC_INTERVAL = Sync interval in minutes

dbs.js

const dbs = {
  // start db schema
  'notion db id': {
    title: 'Title field name from notion',
    description: 'Description field name from notion',
    date: 'Date field name from notion',
    location: 'Location field name from notion',
    meetingURL: 'Meeting URL field name from notion',
    gcalID: 'GCal ID field name from Notion',
    eventEnded: 'Event ended field name from Notion',
    isGCal: 'Field name of checkbox for marking event as a GCal event',
    additional: {},
    config: {
      createEvents: {
        enabled: true,
        targetGCalId: 'GCal ID to create new events on',
      },
      excludeNonGCal: {
        enabled: true,
        polarity: true,
      },
    }
  },
  // end db schema
  // add more dbs here if you need | follow the same schema as above
}

module.exports = dbs

Fields

Field Explaination Property type Nullable
title This is the title of the event title
description The event's description (currently not formatted correctly) text
date The start and end date of an event date
location The location of the event text
meetingURL The URL of the Google Meet conference assigned to the event url
gcalID The field where Google Calendar IDs are stored text
eventEnded This field will get checked if the event lies in the past checkbox
isGCal This checkbox determines whether an event will be synced to Google Calendars checkbox
additional Additional fields for this database
see Custom Properties
any

If a field is nullable this means that it's not required and can be disabled by replacing the string with null
Example: disabling the meeting url

const dbs = {
  'notion db id': {
    title: 'Title field name from notion',
    description: 'Description field name from notion',
    date: 'Date field name from notion',
    location: 'Location field name from notion',
    meetingURL: null,
    gcalID: 'GCal ID',
    eventEnded: 'Done',
    isGCal: 'Gcal Event,
    additional: {},
    config: {
      createEvents: {
        enabled: true,
        targetGCalId: 'primary',
      },
      excludeNonGCal: {
        enabled: true,
        polarity: true,
      },
    }
  },
}

module.exports = dbs

Config

You can configure certain features for each Notion database. They all usually have a key in them called enabled. This key will determine whether the feature is active or not.
Additional keys for features are listed below.

createEvents: Add events created on Notion to a Google Calendar
  • targetGCalId is the id of the Google Calendar where newly created events from Notion should be added
excludeNonGCal: Exclude database entries from syncing to Google Calendars
  • polarity determines whether the checkbox needs to be checked (true) or unchecked (false) in order for the event to be synced

gcal-sync.js

const gcals = [
  // start gcal schema
  {
    id: 'gcal id',
    notionDB: 'notion db id',
    additional: {} // <-- add aditional fields for this GCal | see https://github.com/DerLev/notion-gcal-sync/wiki/Custom-Properties
  },
  // end gcal schema
  // add more gcals here if you need | follow the same schema as above
]
module.exports = gcals