createGoogleDriveProviderFactory
function createGoogleDriveProviderFactory(options?: GoogleDriveProviderOptions): ProviderFactory;Defined in: src/providers/cloud/GoogleDriveProvider.ts:111
Creates a Google Drive provider factory.
The bearer token is resolved per-connection from profile.password
(typically an OAuth 2 access token). profile.host is unused. Set
rootFolderId to scope the provider to a shared-drive subtree instead
of the authenticated user’s My Drive root.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | GoogleDriveProviderOptions | Optional rootFolderId, fetch, and default headers. |
Returns
Section titled “Returns”Provider factory suitable for createTransferClient({ providers: [...] }).
Example
Section titled “Example”import { createGoogleDriveProviderFactory, createTransferClient, uploadFile } from "@zero-transfer/sdk";
const client = createTransferClient({ providers: [createGoogleDriveProviderFactory({ rootFolderId: "0AB1cDeFG2HiJk" })],});
await uploadFile({ client, localPath: "./contracts/2026-Q2.pdf", destination: { path: "/Contracts/2026-Q2.pdf", profile: { host: "", provider: "google-drive", password: { env: "GOOGLE_OAUTH_ACCESS_TOKEN" }, }, },});