Functions
class Functions(val config: Functions.Config, val supabaseClient: SupabaseClient) : MainPlugin<Functions.Config> , CustomSerializationPlugin(source)
Plugin to interact with the supabase Edge Functions API
To use it you need to install it to the SupabaseClient:
val supabase = createSupabaseClient(supabaseUrl, supabaseKey) {
install(Functions)
}
Content copied to clipboard
then you can use it like this:
val response = supabase.functions("myFunction")
//or store it in a variable
val function = supabase.functions.buildEdgeFunction("myFunction")
val response = function()
Content copied to clipboard
Types
Properties
Functions
Link copied to clipboard
fun buildEdgeFunction(function: String, region: FunctionRegion = config.defaultRegion, headers: Headers = Headers.Empty): EdgeFunction
Builds an EdgeFunction which can be invoked multiple times
Link copied to clipboard
inline suspend operator fun invoke(function: String, region: FunctionRegion = config.defaultRegion, headers: Headers = Headers.Empty): HttpResponse
inline suspend operator fun invoke(function: String, region: FunctionRegion = config.defaultRegion, crossinline builder: HttpRequestBuilder.() -> Unit): HttpResponse
Invokes a remote edge function. The authorization token is automatically added to the request.
inline suspend operator fun <T : Any> invoke(function: String, body: T, region: FunctionRegion = config.defaultRegion, headers: Headers = Headers.Empty): HttpResponse
Invokes a remote edge function. The authorization token is automatically added to the request. Note, if you want to serialize body to json, you need to add the HttpHeaders.ContentType header yourself.
Link copied to clipboard
Link copied to clipboard