Beignet API reference
    Preparing search index...

    Interface S3StorageProviderOptions

    Options for creating an env-backed S3-compatible storage provider.

    interface S3StorageProviderOptions {
        bucket?: string;
        clientConfig?: Omit<
            S3ClientConfig,
            | "region"
            | "endpoint"
            | "credentials"
            | "forcePathStyle"
            | "maxAttempts"
            | "retryMode",
        >;
        createClient?: (config: S3StorageConfig) => S3StorageClient;
        credentials?: {
            accessKeyId: string;
            secretAccessKey: string;
            sessionToken?: string;
        };
        endpoint?: string;
        forcePathStyle?: boolean;
        keyPrefix?: string;
        maxAttempts?: number;
        name?: string;
        publicBaseUrl?: string;
        region?: string;
        retryMode?: "standard"
        | "adaptive";
    }

    Hierarchy

    • Omit<S3StorageOptions, "bucket" | "client" | "instrumentation">
      • S3StorageProviderOptions
    Index
    bucket?: string

    Default bucket used when STORAGE_S3_BUCKET is not set.

    clientConfig?: Omit<
        S3ClientConfig,
        | "region"
        | "endpoint"
        | "credentials"
        | "forcePathStyle"
        | "maxAttempts"
        | "retryMode",
    >

    Additional AWS SDK S3Client config.

    createClient?: (config: S3StorageConfig) => S3StorageClient

    Optional client factory for tests or custom S3 clients.

    Clients returned here are caller-owned: the provider stop hook does not destroy them, so close them yourself when your app shuts down.

    credentials?: {
        accessKeyId: string;
        secretAccessKey: string;
        sessionToken?: string;
    }

    Static credentials used when creating the default S3Client.

    endpoint?: string

    S3-compatible endpoint. Required for R2, MinIO, Spaces, B2, and most non-AWS object stores.

    forcePathStyle?: boolean

    Use path-style bucket addressing when required by the object store.

    keyPrefix?: string

    Prefix all object keys before sending them to S3.

    maxAttempts?: number

    Maximum request attempts, including the first attempt, used when creating the default S3Client. Retries are handled by the AWS SDK.

    3
    
    name?: string

    Provider name. Defaults to "storage-s3".

    publicBaseUrl?: string

    Base URL used by publicUrl(...) for public objects.

    region?: string

    Region used when creating the default S3Client.

    "us-east-1"
    
    retryMode?: "standard" | "adaptive"

    AWS SDK retry mode used when creating the default S3Client. "adaptive" adds client-side rate limiting on top of "standard" retries.

    "standard"