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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | GcsProviderOptions | Bucket plus optional fetch/transport overrides. |
Returns
Section titled “Returns”Provider factory suitable for createTransferClient({ providers: [...] }).
Example
Section titled “Example”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" }, }, },});