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" />
<PackageReference Include="Nefarius.Backblaze.NativeApi" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=Nefarius.Backblaze.NativeApi&version=1.0.0-pre005&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Nefarius.Backblaze.NativeApi
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
AddBackblazeUploaderto wire up typed HTTP clients and configuration in DI containers. IBackblazeUploaderfor uploading files or streams with automatic SHA1 calculation and upload URL negotiation.IBackblazeBucketClientfor 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
3rd party credits
| Product | Versions 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.
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Refit (>= 9.0.2)
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 |