Supplies the access token for Database, Storage and Edge Functions requests from an async callback. The callback is awaited before every request and its token is sent as Authorization: Bearer. Use it with a third-party auth provider such as Clerk, Auth0, Firebase or Cognito.
null, the request is sent with the project API key, as when no user is signed in. If the callback throws, the request fails with that exception.SupabaseOptions.ThirdPartyAccessToken, the client builds no Supabase Auth client. supabase.Auth and supabase.AdminAuth throw InvalidOperationException.Authorization entry in SupabaseOptions.Headers.RetrieveAccessToken on their ClientOptions (Supabase.Postgrest, Supabase.Storage and Supabase.Functions). The Functions callback is skipped when the call passes a token or an Authorization header of its own.var options = new Supabase.SupabaseOptions
{
ThirdPartyAccessToken = cancellationToken => clerk.GetTokenAsync(cancellationToken)
};
var supabase = new Supabase.Client(url, key, options);
var result = await supabase.From<City>().Get();
var client = new Supabase.Postgrest.Client(url, new Supabase.Postgrest.ClientOptions
{
RetrieveAccessToken = cancellationToken => tokenStore.GetTokenAsync(cancellationToken)
});