ValiBlob.Supabase
1.0.0
Error en el nombre de paquete.
dotnet add package ValiBlob.Supabase --version 1.0.0
NuGet\Install-Package ValiBlob.Supabase -Version 1.0.0
<PackageReference Include="ValiBlob.Supabase" Version="1.0.0" />
<PackageVersion Include="ValiBlob.Supabase" Version="1.0.0" />
<PackageReference Include="ValiBlob.Supabase" />
paket add ValiBlob.Supabase --version 1.0.0
#r "nuget: ValiBlob.Supabase, 1.0.0"
#:package ValiBlob.Supabase@1.0.0
#addin nuget:?package=ValiBlob.Supabase&version=1.0.0
#tool nuget:?package=ValiBlob.Supabase&version=1.0.0
Vali-Blob.Supabase
Supabase Storage provider for Vali-Blob — the unified cloud storage abstraction library for .NET.
Implements IStorageProvider over the Supabase Storage REST API with signed URL generation, resumable uploads via the TUS protocol, public and private bucket support, and seamless DI registration.
Compatibility
| Target Framework | Supported |
|---|---|
netstandard2.0 |
Yes |
netstandard2.1 |
Yes |
net6.0 |
Yes |
net7.0 |
Yes |
net8.0 |
Yes |
net9.0 |
Yes |
Installation
dotnet add package ValiBlob.Core
dotnet add package ValiBlob.Supabase
Configuration
{
"ValiBlob": {
"DefaultProvider": "Supabase"
},
"ValiBlob:Supabase": {
"Url": "https://your-project-ref.supabase.co",
"ApiKey": "",
"Bucket": "my-bucket"
}
}
Security: Never commit
ApiKeyto source control. Use environment variables or a secrets manager. Use theservice_rolekey for server-side operations with full access. For user-facing operations, use a scoped anon key with Row Level Security (RLS) policies configured in Supabase.
Registration
using ValiBlob.Core.DependencyInjection;
using ValiBlob.Supabase.Extensions;
builder.Services
.AddValiBlob(opts => opts.DefaultProvider = "Supabase")
.UseSupabase();
With pipeline
builder.Services
.AddValiBlob(opts => opts.DefaultProvider = "Supabase")
.UseSupabase()
.WithPipeline(p => p
.UseValidation(v =>
{
v.AllowedExtensions = new[] { ".jpg", ".png", ".gif", ".webp" };
v.MaxFileSizeBytes = 10 * 1024 * 1024; // 10 MB
})
);
Usage
Upload
public class AvatarService(IStorageProvider storage)
{
public async Task<string> UploadAvatarAsync(Stream image, string userId, string extension)
{
var result = await storage.UploadAsync(new UploadRequest
{
Path = StoragePath.From("avatars", $"{userId}{extension}"),
Content = image,
ContentType = "image/jpeg"
});
if (!result.IsSuccess)
throw new Exception(result.ErrorMessage);
return result.Value!.Url;
}
}
Download
var result = await storage.DownloadAsync(new DownloadRequest
{
Path = StoragePath.From("avatars", "user-123.jpg")
});
if (result.IsSuccess)
await result.Value!.CopyToAsync(Response.Body);
Public bucket URL
For objects in a public bucket, the URL is returned directly in the upload result:
var result = await storage.UploadAsync(request);
var publicUrl = result.Value!.Url;
// → "https://your-project.supabase.co/storage/v1/object/public/avatars/user-123.jpg"
Signed URL (private bucket)
var url = await storage.GetPresignedDownloadUrlAsync(new PresignedUrlRequest
{
Path = StoragePath.From("private-docs", "contract.pdf"),
ExpiresIn = TimeSpan.FromHours(1)
});
return Redirect(url.Value!);
Resumable upload (TUS protocol)
Supabase Storage implements the TUS resumable upload protocol. Use this for large files — the upload can be paused and resumed after network interruptions:
public class UploadService(IResumableUploadProvider resumable)
{
public async Task UploadVideoAsync(Stream content, string fileName, long totalSize)
{
// Start session — returns a TUS upload URL
var session = await resumable.StartUploadAsync(new ResumableUploadRequest
{
FileName = fileName,
ContentType = "video/mp4",
TotalSize = totalSize
});
// Upload in chunks (e.g. 6 MB each — Supabase default chunk size)
var buffer = new byte[6 * 1024 * 1024];
int chunkIndex = 0, read;
while ((read = await content.ReadAsync(buffer)) > 0)
{
await resumable.UploadChunkAsync(new ResumableChunkRequest
{
SessionId = session.SessionId,
ChunkIndex = chunkIndex++,
Data = new MemoryStream(buffer, 0, read)
});
}
await resumable.CompleteUploadAsync(session.SessionId);
}
}
Features
| Feature | Supported |
|---|---|
| Upload / Download / Delete / List | Yes |
| Exists check | Yes |
| Copy / Move | Yes |
| Public bucket URLs | Yes |
| Signed download URL | Yes |
| Resumable uploads (TUS protocol) | Yes |
| BucketOverride per request | Yes |
| RLS / scoped API key support | Yes |
| Polly retry resilience | Yes |
Options reference
| Property | Default | Description |
|---|---|---|
Url |
— | Supabase project URL (required) |
ApiKey |
— | Supabase API key (service_role or anon) |
Bucket |
— | Default storage bucket name |
SignedUrlExpirySeconds |
3600 |
Default signed URL expiry in seconds |
Documentation
Links
Donations
If Vali-Blob is useful to you, consider supporting its development:
- Latin America — MercadoPago
- International — PayPal
License
Contributions
Issues and pull requests are welcome on GitHub.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- System.Text.Json (>= 8.0.5)
- ValiBlob.Core (>= 1.0.0)
-
.NETStandard 2.1
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- System.Text.Json (>= 8.0.5)
- ValiBlob.Core (>= 1.0.0)
-
net6.0
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- ValiBlob.Core (>= 1.0.0)
-
net7.0
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- ValiBlob.Core (>= 1.0.0)
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- ValiBlob.Core (>= 1.0.0)
-
net9.0
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- ValiBlob.Core (>= 1.0.0)
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 |
|---|
See CHANGELOG.md at https://github.com/UBF21/Vali-Blob/blob/main/CHANGELOG.md