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<{ data: EdgeFunction | null; error: Error | null; }>

Get details of a specific edge function

ParameterTypeDescription
namestringFunction name

Promise<{ data: EdgeFunction | null; error: Error | null; }>

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

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

invoke<T>(functionName, options?): Promise<{ data: T | null; error: Error | null; }>

Invoke an edge function

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

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

Promise<{ data: T | null; error: Error | null; }>

Promise resolving to { data, error } tuple

// 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<{ data: EdgeFunction[] | null; error: Error | null; }>

List all public edge functions

Promise<{ data: EdgeFunction[] | null; error: Error | null; }>

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

const { data, error } = await client.functions.list()
if (data) {
console.log('Functions:', data.map(f => f.name))
}