Skip to content

FluxbaseFunctions

Edge Functions client for invoking serverless functions API-compatible with Supabase Functions

For admin operations (create, update, delete, sync), use client.admin.functions

new FluxbaseFunctions(fetch): FluxbaseFunctions

ParameterType
fetchFluxbaseFetch

FluxbaseFunctions

get(name): Promise<object>

Get details of a specific edge function

ParameterTypeDescription
namestringFunction name

Promise<object>

Promise resolving to { data, error } tuple with function metadata

NameType
datanull | EdgeFunction
errornull | Error
const { data, error } = await client.functions.get('my-function')
if (data) {
console.log('Function version:', data.version)
}

invoke<T>(functionName, options?): Promise<object>

Invoke an edge function

This method is fully compatible with Supabase’s functions.invoke() API.

Type ParameterDefault type
Tany
ParameterTypeDescription
functionNamestringThe name of the function to invoke
options?FunctionInvokeOptionsInvocation options including body, headers, HTTP method, and namespace

Promise<object>

Promise resolving to { data, error } tuple

NameType
datanull | T
errornull | Error
// Simple invocation (uses first matching function by namespace alphabetically)
const { data, error } = await client.functions.invoke('hello', {
body: { name: 'World' }
})
// Invoke a specific namespace's function
const { data, error } = await client.functions.invoke('hello', {
body: { name: 'World' },
namespace: 'my-app'
})
// With GET method
const { data, error } = await client.functions.invoke('get-data', {
method: 'GET'
})
// With custom headers
const { data, error } = await client.functions.invoke('api-proxy', {
body: { query: 'search' },
headers: { 'Authorization': 'Bearer token' },
method: 'POST'
})

list(): Promise<object>

List all public edge functions

Promise<object>

Promise resolving to { data, error } tuple with array of public functions

NameType
datanull | EdgeFunction[]
errornull | Error
const { data, error } = await client.functions.list()
if (data) {
console.log('Functions:', data.map(f => f.name))
}