> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opennous.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Gmail & Google Calendar

> Sync emails and calendar events automatically via Google OAuth.

<Note>
  This requires registering a Google OAuth app. You do this once as the server admin — your users then connect their own Google accounts via the UI.
</Note>

## Server Setup

<Steps>
  <Step title="Create a Google Cloud project">
    Go to [console.cloud.google.com](https://console.cloud.google.com) and create a new project (or use an existing one).
  </Step>

  <Step title="Enable Gmail API and Google Calendar API">
    In the sidebar go to **APIs & Services → Library**. Search for and enable both:

    * **Gmail API**
    * **Google Calendar API**

    <Frame>
      <img src="https://mintcdn.com/proply/oZTKyiGabKRwyzM-/images/Screenshot-2026-05-18-at-11.07.39-AM.png?fit=max&auto=format&n=oZTKyiGabKRwyzM-&q=85&s=2c4db9f03c8293774f0fbaba1b4f09dd" alt="Screenshot 2026 05 18 At 11 07 39 AM" title="Screenshot 2026 05 18 At 11 07 39 AM" style={{ width:"40%" }} width="1004" height="592" data-path="images/Screenshot-2026-05-18-at-11.07.39-AM.png" />
    </Frame>
  </Step>

  <Step title="Configure the OAuth consent screen">
    Go to **APIs & Services → OAuth consent screen**. Choose **External**, fill in the app name and your email, then add these scopes:

    ```text theme={null}
    https://www.googleapis.com/auth/gmail.readonly
    https://www.googleapis.com/auth/calendar.readonly
    ```

    Add your own email as a test user while in development.
  </Step>

  <Step title="Create OAuth credentials">
    Go to **APIs & Services → Credentials → Create Credentials → OAuth client ID**. Choose **Web application** and add your redirect URI:

    <Frame>
      <img src="https://mintcdn.com/proply/oZTKyiGabKRwyzM-/images/Screenshot-2026-05-18-at-11.10.20-AM.png?fit=max&auto=format&n=oZTKyiGabKRwyzM-&q=85&s=311dc994f11578443f8a647955490923" alt="Screenshot 2026 05 18 At 11 10 20 AM" width="1764" height="998" data-path="images/Screenshot-2026-05-18-at-11.10.20-AM.png" />
    </Frame>

    ```text theme={null}
    https://api.yourdomain.com/api/oauth/google/callback
    ```

    <Frame>
      <img src="https://mintcdn.com/proply/oZTKyiGabKRwyzM-/images/Screenshot-2026-05-18-at-11.11.57-AM.png?fit=max&auto=format&n=oZTKyiGabKRwyzM-&q=85&s=df8fbbc73270e95476d17d4958c8ae29" alt="Screenshot 2026 05 18 At 11 11 57 AM" width="1764" height="1360" data-path="images/Screenshot-2026-05-18-at-11.11.57-AM.png" />
    </Frame>
  </Step>

  <Step title="Copy your Client ID and Secret">
    After creating, copy the **Client ID** and **Client Secret**.
  </Step>

  <Step title="Add to nous.env">
    ```bash theme={null}
    GOOGLE_CLIENT_ID=your-client-id
    GOOGLE_CLIENT_SECRET=your-client-secret
    GOOGLE_OAUTH_REDIRECT_URI=https://api.yourdomain.com/api/oauth/google/callback
    ```

    Restart your containers after saving.
  </Step>
</Steps>

## Connecting in Nous

Once the server is configured, each workspace connects their own Google account:

1. Go to **Integrations**
2. Click **+ Add Integration → Google Calendar / Gmail**
3. Complete the OAuth flow in the popup

## What gets synced

| Data                        | How          | Frequency    |
| --------------------------- | ------------ | ------------ |
| Sent & received emails      | Gmail API    | Every 30 min |
| Calendar events + attendees | Calendar API | Every 10 min |
