@backblaze-labs/b2-sdk - v0.2.0
    Preparing search index...

    Interface B2ClientOptions

    Configuration options for creating a B2Client.

    interface B2ClientOptions {
        accountInfo?: AccountInfo;
        allowedHostSuffixes?: readonly string[];
        applicationKey: string;
        applicationKeyId: string;
        followSameOriginRedirects?: boolean;
        realm?: string;
        retry?: Partial<RetryOptions>;
        transport?: HttpTransport;
        userAgent?: string;
    }
    Index

    Properties

    accountInfo?: AccountInfo

    Storage backend for authorization state. Defaults to InMemoryAccountInfo.

    allowedHostSuffixes?: readonly string[]

    Override the SSRF allow-list. By default the SDK locks the FetchTransport to host suffixes derived from the realm's authorize response (e.g. backblazeb2.com, backblaze.com) so a compromised B2 endpoint cannot redirect the SDK to internal services. Pass an explicit list to add hosts (e.g. when testing against a self-hosted proxy) or set to an empty array to disable the guard entirely (not recommended).

    Only consulted when B2ClientOptions.transport is unset; a custom transport is the user's responsibility to harden.

    applicationKey: string

    The application key secret.

    applicationKeyId: string

    The application key ID from the B2 dashboard or b2_create_key.

    followSameOriginRedirects?: boolean

    Follow same-origin GET/HEAD redirects in the default fetch transport after checking each target with the SSRF guard. POST redirects remain blocked. Defaults to true.

    realm?: string

    B2 realm to authenticate against. Accepts a known realm-map key ("production" or "staging") or a direct base URL. Custom HTTPS hosts are trusted with the application key during authorize, so never derive realm from untrusted input. URL values must use HTTPS, or loopback IP literal HTTP for local testing only; application-key credentials are sent unencrypted over loopback HTTP. Unsupported schemes, malformed URLs, non-URL strings, plaintext HTTP hostnames such as localhost, and non-loopback plaintext HTTP are rejected before credentials are sent. URL values must not include userinfo, query strings, or fragments. Defaults to "production".

    retry?: Partial<RetryOptions>

    Override retry behavior (max retries, backoff, and per-attempt timeout).

    transport?: HttpTransport

    Custom HTTP transport. Defaults to FetchTransport. Wrapped by RetryTransport.

    userAgent?: string

    Custom user-agent string prepended to the SDK default.