This topic covers syncing events between Discourse and Google Calendar. Here’s a video of me setting that up:
Setting up the connection to Google Calendar
The first step is to set up a connection to Google Calendar.
Set up Google Cloud
You’ll need a Google Cloud account that has access to the Google calendar(s) you want to sync. If you haven’t done that, go to https://cloud.google.com/cloud-console and sign up with a google account that can administer the calendar(s).
Once you have a Cloud account, follow the steps in the “Set up your environment” portion of this Google Help Article
When you’re performing the " Authorize credentials for a desktop application" step, make these choices:
- Set the “Application type” to “Web application”.
- Set an Authorized Redirect URI as
[forum_url]/admin/plugins/events/provider/redirect
. For example:https://test.angus.blog/admin/plugins/events/provider/redirect
When you’re done you should have:
- Enabled the Google Calendar API
- Set up your OAuth 2.0 Consent Screen
- Set up Authorize Credentials and downloaded the credentials json file.
Set up Google Calendar Provider
Now go to the Events Plugin admin panel in your Discourse and click on “Providers”. Enter the “Client ID” (client_id
) and “Client Secret” (client_secret
) from the credentials json file you downloaded in the previous step.
{
"web": {
"client_id": [Copy this and paste it into Client ID],
"project_id": "angus-blog",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": [Copy this and paste it into Client Secret],
"redirect_uris": []
}
}
Then click “Authenticate” on the right. You’ll be taken to a Google Consent screen and asked to give the Events Plugin access to your event data. Once you’ve consented, you’ll be redirected back to your Events Plugin admin panel and you should now see a “Ready” status in the Google Calendar provider row.
Setting up the event sync
Once you’ve set up Google Calendar as a provider click on “Sources” in the Events Plugin admin panel and click “+ Add Source”.
The options you select here will depend on what kind of sync you want. Each option has a short description under it, and some of those descriptions will update when you change the selection to give you further details on what your selection means. We’ll go over the options specific to Google Calendar here. If you want further information on other options, or help setting up a Source for a specific use case, please reach out to @angus
How to get a Google Calendar ID
You’ll find the Google Calendar ID in the settings for the calendar.