backblaze-labs/b2-action - v0.1.0
    Preparing search index...

    Function buildClient

    • Build an authorized B2Client.

      Steps:

      1. Construct the client with userAgent: 'b2-github-action/<version>'. The SDK preserves its own b2-sdk-ts/ and @backblaze/b2-sdk tokens before ours so Backblaze server-side logs see both attribution layers.
      2. await client.authorize(). This is one-shot for the lifetime of the action invocation. B2 auth tokens carry a 24h TTL; typical GitHub Actions runs finish well inside that window. If a long-running job outlives the token, the SDK transparently re-authorizes on the next 401, so the action layer does not need its own refresh loop.
      3. Mask the resulting authorization token via core.setSecret so any later log line that happens to include it (errors, debug traces) is redacted.

      The transport parameter is only used by tests (the SDK's B2Simulator provides one). Production callers leave it undefined to use the SDK's default FetchTransport with its built-in SSRF guard.

      Parameters

      Returns Promise<AuthorizedClient>