Supabase.Functions
2.2.0
dotnet add package Supabase.Functions --version 2.2.0
NuGet\Install-Package Supabase.Functions -Version 2.2.0
<PackageReference Include="Supabase.Functions" Version="2.2.0" />
<PackageVersion Include="Supabase.Functions" Version="2.2.0" />
<PackageReference Include="Supabase.Functions" />
paket add Supabase.Functions --version 2.2.0
#r "nuget: Supabase.Functions, 2.2.0"
#:package Supabase.Functions@2.2.0
#addin nuget:?package=Supabase.Functions&version=2.2.0
#tool nuget:?package=Supabase.Functions&version=2.2.0
Supabase.Functions
[Notice]: v2.0.0 renames this package from functions-csharp to Supabase.Functions. The depreciation notice has been set in NuGet. The API remains the same.
C# Client library to interact with Supabase Functions.
Observability (OpenTelemetry)
The client emits traces and metrics through System.Diagnostics, so you can wire them into
OpenTelemetry (or any ActivityListener/MeterListener) without the client taking a dependency
on the OpenTelemetry packages. Emission is zero-cost while nothing is listening, so it is always
on and stays silent until you subscribe.
Register the client's ActivitySource and Meter by name. Use the FunctionsDiagnostics.SourceName
constant rather than hardcoding the string, so a typo becomes a compile error instead of a silent
no-op:
using OpenTelemetry.Metrics;
using OpenTelemetry.Trace;
using Supabase.Functions;
// Requires the OpenTelemetry.Extensions.Hosting and an exporter package (e.g. OTLP) in your app.
builder.Services.AddOpenTelemetry()
.WithTracing(tracing => tracing
.AddSource(FunctionsDiagnostics.SourceName)
.AddOtlpExporter())
.WithMetrics(metrics => metrics
.AddMeter(FunctionsDiagnostics.SourceName)
.AddOtlpExporter());
Once subscribed you get:
- A client span per invocation, named
{METHOD} {path}and following OpenTelemetry HTTP conventions (method, status code, and a sanitized URL — the query string is never recorded, and neither is the request body). Afaas.invoked_nametag carries the invoked function name. A relay error is reported as a failed span even when the HTTP status is a success. - A
supabase.functions.invoke.durationhistogram (seconds), tagged with method, host, path, function name, and status code.
If you are not using the OpenTelemetry SDK, a raw listener works too:
using System.Diagnostics;
using Supabase.Functions;
using var listener = new ActivityListener
{
ShouldListenTo = source => source.Name == FunctionsDiagnostics.SourceName,
Sample = (ref ActivityCreationOptions<ActivityContext> _) => ActivitySamplingResult.AllData,
ActivityStopped = activity => Console.WriteLine($"{activity.OperationName} {activity.Duration.TotalMilliseconds}ms {activity.Status}")
};
ActivitySource.AddActivityListener(listener);
Package made possible through the efforts of:
Join the ranks! See a problem? Help fix it!
<a href="https://github.com/supabase-community/functions-csharp/graphs/contributors"> <img src="https://contrib.rocks/image?repo=supabase-community/functions-csharp" /> </a>
<small>Made with contrib.rocks.</small>
Contributing
We are more than happy to have contributions! Please submit a PR.
Testing
To run the tests locally you must have docker and docker-compose installed. Then in the root of the repository run:
docker-compose up -ddotnet test
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 was computed. 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 was computed. 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 was computed. |
| .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
- Newtonsoft.Json (>= 13.0.2)
- Supabase.Core (>= 1.2.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Supabase.Functions:
| Package | Downloads |
|---|---|
|
Supabase
A C# implementation of the Supabase client |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Supabase.Functions:
| Repository | Stars |
|---|---|
|
supabase-community/supabase-csharp
A C# Client library for Supabase
|