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

# Google Drive Datasource

> Configure and manage the synchronization between a Google Drive content and Paradigm.

Configure and manage the synchronization between a Google Drive content and Paradigm.

This page contains the setup guide and reference information for the Google Drive source connector.

The Google Drive source connector pulls data from a folder in Google Drive. Subfolders are recursively included in the sync. All files in the specified folder and all sub folders will be considered, excluding filetypes that are not supported or too large.

## Prerequisites

* Drive folder link - The link to the Google Drive folder you want to sync files from (includes files located in subfolders)
* A GCP project
* Enable the Google Drive API in your GCP project
* Service Account Key with access to the Google Drive folder you want to synchronize

## Setup guide

The Google Drive source connector supports authentication Service Account Key Authentication.

## Set up the service account key

### Create a service account

1. Open the [Service Accounts page](https://console.cloud.google.com/projectselector2/iam-admin/serviceaccounts) in your Google Cloud console.

2. Select an existing project, or create a new project.

3. At the top of the page, click **+ Create service account**.

4. Enter a name and description for the service account, then click **Create and Continue**.

5. Under **Service account permissions**, select the roles to grant to the service account, then click **Continue**. We recommend the **Viewer** role.

### Generate a key

1. Go to the [API Console/Credentials](https://console.cloud.google.com/apis/credentials) page and click on the email address of the service account you just created.

2. In the **Keys** tab, click **+ Add key**, then click **Create new key**.

3. Select **JSON** as the Key type. This will generate and download the JSON key file that you'll use for authentication. Click **Continue**.

### Enable the Google Drive API

1. Go to the [API Console/Library](https://console.cloud.google.com/apis/library) page.

2. Make sure you have selected the correct project from the top.

3. Find and select the **Google Drive API**.

4. Click **ENABLE**.

<Note>
  If your folder is viewable by anyone with its link, no further action is needed. If not, give your Service account access to your folder. Check out [this video](https://youtu.be/GyomEw5a2NQ) for how to do this.
</Note>

## In the Paradigm admin

### Datasource Configuration

1. Navigate to the DATASOURCES section in your Paradigm admin interface

2. Create a new Datasource with Datasource type = **Google Drive**

3. Add your Google Cloud service account key in JSON format:

```json theme={null}
{
  "type": "service_account",
  "project_id": "YOUR_PROJECT_ID",
  "private_key_id": "YOUR_PRIVATE_KEY",
  ...
}
```

4. For **Folder Link**, enter the link to the Google Drive folder. To get the link, navigate to the folder you want to sync in the Google Drive UI, and copy the current URL.

5. Configure the optional **Start Date** parameter that marks a starting date and time in UTC for data replication. Any files that have *not* been modified since this specified date/time will *not* be replicated. Use the provided datepicker (recommended) or enter the desired date programmatically in the format `YYYY-MM-DDTHH:mm:ssZ`. Leaving this field blank will replicate data from all files that have not been excluded by the **Path Pattern** and **Path Prefix**.

6. Click **Set up source** and wait for the tests to complete.

## Authentication Method

### Service Account Key Authentication

* Uses JSON key file generated from Google Cloud Console
* Provides secure access to Google Drive folders
* Requires proper role assignment (Viewer role recommended)
* Service account must have access to the target Google Drive folder

## File Synchronization Details

### Included Content

* All files in the specified folder
* Files in all subfolders (recursive sync)
* Only supported file types are processed
* Files within size limits are included

### Excluded Content

* Unsupported file types are automatically excluded
* Files that exceed size limits are skipped
* Files can be filtered using Path Pattern and Path Prefix settings

## Troubleshooting

### Common Issues

**Authentication Errors**

* Verify the service account JSON key is correctly formatted
* Ensure the service account has the necessary permissions
* Check that the Google Drive API is enabled for your project

**Access Denied Errors**

* Confirm the service account has access to the target folder
* For private folders, explicitly share the folder with the service account email
* Verify folder permissions and sharing settings

**Sync Issues**

* Check the folder link format is correct
* Verify the Start Date parameter if used
* Review file type and size limitations

For additional support with Google Drive datasource configuration, contact the development team.
