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

    Function createNativeDownloadAuthorizationUrl

    • Constructs a B2-native download URL using a token from b2_get_download_authorization. This is not an S3 presigned URL.

      The token lifetime is fixed when b2_get_download_authorization creates the token. validDurationInSeconds is retained only for compatibility with the legacy presignGetObjectUrl helper's decorative expires query parameter; changing it here does not shorten or extend access. Because the returned URL carries a bearer token, downloadUrl must be an HTTPS Backblaze download origin without userinfo, path, query, or fragment.

      Parameters

      • downloadUrl: string

        The B2 download URL from authorization (e.g., https://f004.backblazeb2.com).

      • bucketName: string

        The bucket containing the file.

      • fileName: string

        The file name (path) to download.

      • authorizationToken: string

        A download authorization token from b2_get_download_authorization.

      • validDurationInSeconds: number = DEFAULT_NATIVE_DOWNLOAD_URL_EXPIRES_IN

        Compatibility-only value for the non-authoritative expires query.

      Returns string

      The B2 native download-authorization URL string, not an S3 presigned URL.