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

Parameter Type
fetch FluxbaseFetch

FluxbaseFunctions

get(name): Promise<{ data: EdgeFunction | null; error: Error | null; }>

Get details of a specific edge function

Parameter Type Description
name string Function 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 Parameter Default type
T unknown
Parameter Type Description
functionName string The name of the function to invoke
options? FunctionInvokeOptions Invocation 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))
}