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”new FluxbaseFunctions()
Section titled “new FluxbaseFunctions()”new FluxbaseFunctions(
fetch):FluxbaseFunctions
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
fetch | FluxbaseFetch |
Returns
Section titled “Returns”Methods
Section titled “Methods”get(
name):Promise<object>
Get details of a specific edge function
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
name | string | Function name |
Returns
Section titled “Returns”Promise<object>
Promise resolving to { data, error } tuple with function metadata
| Name | Type |
|---|---|
data | null | EdgeFunction |
error | null | Error |
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<object>
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 | any |
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<object>
Promise resolving to { data, error } tuple
| Name | Type |
|---|---|
data | null | T |
error | null | Error |
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<object>
List all public edge functions
Returns
Section titled “Returns”Promise<object>
Promise resolving to { data, error } tuple with array of public functions
| Name | Type |
|---|---|
data | null | EdgeFunction[] |
error | null | Error |
Example
Section titled “Example”const { data, error } = await client.functions.list()if (data) { console.log('Functions:', data.map(f => f.name))}