Skip to content

createGcsProviderFactory

function createGcsProviderFactory(options: GcsProviderOptions): ProviderFactory;

Defined in: src/providers/cloud/GcsProvider.ts:129

Creates a Google Cloud Storage provider factory.

Authentication is per-connection: pass a Google OAuth 2 access token via profile.password. profile.host is unused - the bucket is fixed at factory construction time so a single client can target multiple buckets by registering separate factories.

ParameterTypeDescription
optionsGcsProviderOptionsBucket plus optional fetch/transport overrides.

ProviderFactory

Provider factory suitable for createTransferClient({ providers: [...] }).

import { createGcsProviderFactory, createTransferClient, uploadFile } from "@zero-transfer/sdk";
const client = createTransferClient({
providers: [createGcsProviderFactory({ bucket: "my-bucket" })],
});
await uploadFile({
client,
localPath: "./build/app.tar.gz",
destination: {
path: "releases/2026.04/app.tar.gz",
profile: {
host: "my-bucket",
provider: "gcs",
password: { env: "GCP_OAUTH_ACCESS_TOKEN" },
},
},
});