CarpoSDK docs

Invoke Functions from a server

Call a deployed Function with a server or request scoped client.

The combined server client exposes the same Fetch compatible Functions client as the React SDK:

const response = await carpo.functions.invoke('function-id', {
  path: '/reports/current',
  method: 'GET',
})

if (!response.ok) {
  throw new Error(`Function returned ${response.status}`)
}

Use invokeJson<T>() when the Function returns JSON. It parses the response and throws CarpoApiError for a non successful status. Use invoke() for streamed or non JSON responses.

For protected Function deployments, configure the appropriate identity source. createCarpoServerClient() accepts functions.getAccessToken for a Project Auth token or project API key. createCarpoServerRequestClient() forwards the incoming request identity to Function calls by default.

The deployed Function's configured invocation mode remains authoritative. See Invoke Functions for request paths, body options, environment selection, and Fetch response behavior.