PluginsGoogle Drive
Google Drive
Integrate Google Drive files, folders, and shared drives
Quick Start
Install the plugin:
pnpm install @corsair-dev/googledriveAdd the Google Drive plugin to your Corsair instance:
import { createCorsair } from "corsair";
import { googledrive } from "@corsair-dev/googledrive";
export const corsair = createCorsair({
plugins: [
googledrive({
authType: "oauth_2",
}),
],
});Once configured, you can access the Google Drive API through your Corsair instance:
const files = await corsair.googledrive.api.files.list({
pageSize: 10,
});Authentication
Supported Auth Types
The Google Drive plugin uses OAuth 2.0 authentication exclusively.
oauth_2(default) - OAuth 2.0 authentication
OAuth 2.0 Setup
Store your OAuth app credentials, then start the flow:
pnpm corsair setup --googledrive client_id=your-client-id client_secret=your-client-secret
pnpm corsair auth --plugin=googledriveThe CLI will print an authorization URL — open it in a browser. Once you approve, tokens are saved automatically.
See Get Credentials for step-by-step instructions on setting up OAuth 2.0.
See Authentication for details on managing credentials.
Options
The Google Drive plugin accepts the following configuration options:
| Option | Type | Description |
|---|---|---|
authType | 'oauth_2' | Authentication method (defaults to 'oauth_2') |
credentials | object | Credentials object with clientId and clientSecret |
hooks | object | Endpoint hooks for custom logic |
webhookHooks | object | Webhook hooks for event handling |
For complete documentation on getting credentials, see the Plugin Credentials Guide.