@orchesty/connector-google-drive
v2.0.0
Published
[](https://www.npmjs.com/package/@orchesty/connector-google-drive) [](https://github.com/Orchesty/orchesty
Readme
Google Drive Connector
An Orchesty connector for Google Drive, a cloud storage and file sharing service that allows you to store, access, and collaborate on files from any device.
Application Type
OAuth 2.0
This connector uses Google OAuth 2.0 with the auth/drive.file scope. After entering your credentials in Orchesty, you will be redirected to Google to authorize access.
| Field | Description |
|---|---|
| client_id | OAuth Client ID from the Google Cloud Console |
| client_secret | OAuth Client Secret from the Google Cloud Console |
Components
| Class | Type | Description |
|---|---|---|
| GoogleDriveCreateDirectoryConnector | Connector | Creates a new folder in Google Drive via POST /drive/v3/files |
| GoogleDriveUpdateFileConnector | Connector | Updates metadata of an existing Drive file, optionally moving it to a new parent via PATCH /drive/v3/files/{fileId} |
| GoogleDriveUploadFileConnector | Connector | Uploads a file to Google Drive via multipart upload POST /upload/drive/v3/files?uploadType=multipart |
Setup
Credentials
- Go to the Google Cloud Console and open your project.
- Navigate to APIs & Services → Credentials.
- Create an OAuth 2.0 Client ID (type: Web application).
- Add the Orchesty OAuth callback URL to Authorized redirect URIs.
- Copy the Client ID and Client Secret.
- Enable the Google Drive API under APIs & Services → Library.
- In Orchesty, open the Google Drive application settings, enter the credentials, and complete the OAuth authorization flow.
API Documentation
Google Drive REST API: https://developers.google.com/drive/api/reference/rest/v3
Installation & Usage
Install the package:
npm install @orchesty/connector-google-drive @orchesty/nodejs-sdk
# or
pnpm add @orchesty/connector-google-drive @orchesty/nodejs-sdkRegister the application and nodes in your Orchesty DI container:
import { container } from '@orchesty/nodejs-sdk';
import { OAuth2Provider } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Provider/OAuth2/OAuth2Provider';
import GoogleDriveApplication from '@orchesty/connector-google-drive/dist/GoogleDriveApplication';
import GoogleDriveCreateDirectoryConnector from '@orchesty/connector-google-drive/dist/Connector/GoogleDriveCreateDirectoryConnector';
import GoogleDriveUpdateFileConnector from '@orchesty/connector-google-drive/dist/Connector/GoogleDriveUpdateFileConnector';
import GoogleDriveUploadFileConnector from '@orchesty/connector-google-drive/dist/Connector/GoogleDriveUploadFileConnector';
const app = new GoogleDriveApplication(container.get(OAuth2Provider));
container.setApplication(app);
container.setNode(new GoogleDriveCreateDirectoryConnector(), app);
container.setNode(new GoogleDriveUpdateFileConnector(), app);
container.setNode(new GoogleDriveUploadFileConnector(), app);License
This connector is released under the Apache License 2.0. See the LICENSE file for the full license text.
Contributing
Contributions are welcome! This connector is part of the open-source Orchesty Node.js Connectors monorepo.
For guidelines on how to create or update connectors — including project setup, coding conventions, and how to write tests — please refer to the Contributing to Connectors guide.
All contributions should include:
- Source code in
src/following the existing connector structure - Tests in
src/**/__tests__/withinput.json,mock.json, andoutput.jsonfixtures - An updated
CHANGELOG.mdentry
