FluxbaseFunctions
Edge Functions client for invoking serverless functions API-compatible with Supabase Functions
For admin operations (create, update, delete, sync), use client.admin.functions
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FluxbaseFunctions(
fetch):FluxbaseFunctions
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
fetch | FluxbaseFetch |
Returns
Section titled “Returns”FluxbaseFunctions
Methods
Section titled “Methods”get(
name):Promise<{data:EdgeFunction|null;error:Error|null; }>
Get details of a specific edge function
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
name | string | Function name |
Returns
Section titled “Returns”Promise<{ data: EdgeFunction | null; error: Error | null; }>
Promise resolving to { data, error } tuple with function metadata
Example
Section titled “Example”const { data, error } = await client.functions.get('my-function')if (data) { console.log('Function version:', data.version)}invoke()
Section titled “invoke()”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 Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
functionName | string | The name of the function to invoke |
options? | FunctionInvokeOptions | Invocation options including body, headers, HTTP method, and namespace |
Returns
Section titled “Returns”Promise<{ data: T | null; error: Error | null; }>
Promise resolving to { data, error } tuple
Example
Section titled “Example”// 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 functionconst { data, error } = await client.functions.invoke('hello', { body: { name: 'World' }, namespace: 'my-app'})
// With GET methodconst { data, error } = await client.functions.invoke('get-data', { method: 'GET'})
// With custom headersconst { data, error } = await client.functions.invoke('api-proxy', { body: { query: 'search' }, headers: { 'Authorization': 'Bearer token' }, method: 'POST'})list()
Section titled “list()”list():
Promise<{data:EdgeFunction[] |null;error:Error|null; }>
List all public edge functions
Returns
Section titled “Returns”Promise<{ data: EdgeFunction[] | null; error: Error | null; }>
Promise resolving to { data, error } tuple with array of public functions
Example
Section titled “Example”const { data, error } = await client.functions.list()if (data) { console.log('Functions:', data.map(f => f.name))}