Beignet API reference
    Preparing search index...

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

    interface S3StorageProviderOptions {
        bucket?: string;
        clientConfig?: Omit<
            S3ClientConfig,
            "region"
            | "endpoint"
            | "credentials"
            | "forcePathStyle",
        >;
        createClient?: (
            config: {
                ACCESS_KEY_ID?: string;
                BUCKET: string;
                ENDPOINT?: string;
                FORCE_PATH_STYLE?: boolean;
                KEY_PREFIX?: string;
                PUBLIC_BASE_URL?: string;
                REGION: string;
                SECRET_ACCESS_KEY?: string;
                SESSION_TOKEN?: string;
            },
        ) => S3StorageClient;
        credentials?: {
            accessKeyId: string;
            secretAccessKey: string;
            sessionToken?: string;
        };
        endpoint?: string;
        forcePathStyle?: boolean;
        keyPrefix?: string;
        name?: string;
        publicBaseUrl?: string;
        region?: string;
    }

    Hierarchy

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

    Properties

    bucket?: string

    Default bucket used when STORAGE_S3_BUCKET is not set.

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

    Additional AWS SDK S3Client config.

    createClient?: (
        config: {
            ACCESS_KEY_ID?: string;
            BUCKET: string;
            ENDPOINT?: string;
            FORCE_PATH_STYLE?: boolean;
            KEY_PREFIX?: string;
            PUBLIC_BASE_URL?: string;
            REGION: string;
            SECRET_ACCESS_KEY?: string;
            SESSION_TOKEN?: string;
        },
    ) => S3StorageClient

    Optional client factory for tests or custom S3 clients.

    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.

    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"