Corsair
PluginsGoogle Sheets

Google Sheets

Integrate Google Sheets spreadsheets and data management

Quick Start

Install the plugin:

pnpm install @corsair-dev/googlesheets

Add the Google Sheets plugin to your Corsair instance:

corsair.ts
import { createCorsair } from "corsair";
import { googlesheets } from "@corsair-dev/googlesheets";

export const corsair = createCorsair({
    plugins: [
        googlesheets({
            authType: "oauth_2",
        }),
    ],
});

Once configured, you can access the Google Sheets API through your Corsair instance:

const rows = await corsair.googlesheets.api.sheets.getRows({
    spreadsheetId: "spreadsheet-id",
});

Authentication

Supported Auth Types

The Google Sheets 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 --googlesheets client_id=your-client-id client_secret=your-client-secret
pnpm corsair auth --plugin=googlesheets

The 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 Sheets plugin accepts the following configuration options:

OptionTypeDescription
authType'oauth_2'Authentication method (defaults to 'oauth_2')
credentialsobjectCredentials object with clientId and clientSecret
hooksobjectEndpoint hooks for custom logic
webhookHooksobjectWebhook hooks for event handling

For complete documentation on getting credentials, see the Plugin Credentials Guide.