Functions
functions.invoke(name, init?)
Invoke a Function declared with verifyJwt: true.
js
const response = await opencloud.functions.invoke("summarize", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ itemId }),
});
if (!response.ok) throw new Error(await response.text());
const result = await response.json();The SDK obtains and refreshes the user token. It throws OpenCloudAuthError before the request when no session exists.
functions.invokePublic(name, init?)
Invoke a Function declared with verifyJwt: false.
js
const response = await opencloud.functions.invokePublic("status-probe", {
method: "POST",
});The public helper still supplies the anonymous project identity required by the gateway.
Method boundary
There is no functions.request. Do not call REST or Function origins manually; the two documented methods preserve same-origin routing and the intended Auth mode.