Nefarius.Backblaze.NativeApi 1.0.0-pre005

Prefix Reserved
This is a prerelease version of Nefarius.Backblaze.NativeApi.
dotnet add package Nefarius.Backblaze.NativeApi --version 1.0.0-pre005
                    
NuGet\Install-Package Nefarius.Backblaze.NativeApi -Version 1.0.0-pre005
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nefarius.Backblaze.NativeApi" Version="1.0.0-pre005" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nefarius.Backblaze.NativeApi" Version="1.0.0-pre005" />
                    
Directory.Packages.props
<PackageReference Include="Nefarius.Backblaze.NativeApi" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nefarius.Backblaze.NativeApi --version 1.0.0-pre005
                    
#r "nuget: Nefarius.Backblaze.NativeApi, 1.0.0-pre005"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nefarius.Backblaze.NativeApi@1.0.0-pre005
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nefarius.Backblaze.NativeApi&version=1.0.0-pre005&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Nefarius.Backblaze.NativeApi&version=1.0.0-pre005&prerelease
                    
Install as a Cake Tool

Nefarius.Backblaze.NativeApi

.NET Requirements Nuget Nuget

Small wrapper for Backblaze B2 Native API using Refit.

This project is still evolving, so API-breaking changes might occur each update!

About

A thin .NET wrapper around the Backblaze B2 Native API designed to fit into modern dependency injection setups.

Current features

  • Registration helper AddBackblazeUploader to wire up typed HTTP clients and configuration in DI containers.
  • IBackblazeUploader for uploading files or streams with automatic SHA1 calculation and upload URL negotiation.
  • IBackblazeBucketClient for listing file names and file versions in a bucket.
  • Backed by strongly typed Refit clients for authorization, bucket, and upload endpoints.

Usage examples

Dependency injection registration

using Microsoft.Extensions.DependencyInjection;
using Nefarius.Backblaze.NativeApi;

var builder = Host.CreateApplicationBuilder(args);

builder.Services.AddBackblazeUploader(options =>
{
    options.KeyId = builder.Configuration["Backblaze:KeyId"];
    options.ApplicationKey = builder.Configuration["Backblaze:ApplicationKey"];
    options.BucketId = builder.Configuration["Backblaze:BucketId"];
});

Upload a file

using Nefarius.Backblaze.NativeApi;

public class UploaderService(IBackblazeUploader uploader)
{
    public async Task UploadAsync(CancellationToken cancellationToken)
    {
        await uploader.UploadAsync("/path/to/local/file.zip", "backups/file.zip", cancellationToken);
    }
}

List files in a bucket

using Nefarius.Backblaze.NativeApi;
using Nefarius.Backblaze.NativeApi.WebApi.Models;

public class ListingService(IBackblazeBucketClient client, ILogger<ListingService> logger)
{
    public async Task LogFileNamesAsync(CancellationToken cancellationToken)
    {
        B2ListFileNamesResponse files = await client.ListFileNamesAsync(cancellationToken: cancellationToken);

        foreach (B2StorageFile file in files.Files)
        {
            logger.LogInformation("Found remote file: {FileName}", file.FileName);
        }
    }
}

Documentation

Link to API docs.

3rd party credits

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-pre005 224 12/4/2025
1.0.0-pre004 422 11/18/2025
1.0.0-pre003 396 11/17/2025
1.0.0-pre002 401 11/17/2025