跳轉到主要內容

安裝

  1. Add InsForge dependencies to your project
build.gradle.kts:
  1. Initialize InsForge SDK
  1. Enable Logging (Optional)
For debugging, you can configure the SDK log level:
Log LevelDescription
NONENo logging (default, recommended for production)
ERROROnly errors
WARNWarnings and errors
INFOInformational messages
DEBUGDebug info (request method, URL, response status)
VERBOSEFull details (headers, request/response bodies)
Use NONE or ERROR in production to avoid exposing sensitive data in logs.

Android Initialization

  1. Add Chrome Custom Tabs dependency to your build.gradle.kts:
  1. Initialize InsForge SDK (With Chrome Custom Tabs and Session Storage)
  1. Use Jetpack DataStore for Session Storage (Optional)

invoke()

透過 slug 呼叫無伺服器函式。

參數

  • slug (String) - 函式 slug 識別碼
  • body (Any?, optional) - 請求本體(將被 JSON 序列化)

傳回值

範例

帶有類型化請求的範例


invokeRaw()

呼叫函式並取得原始 HTTP 回應。

範例


管理員函式

下列方法需要管理員/服務角色驗證。
這些方法要求用戶端使用服務角色金鑰而不是 anon 金鑰初始化。服務角色金鑰具有提升的權限,應僅在安全的伺服器端環境中使用,決不能在用戶端代碼中使用。

listFunctions()

列出所有函式。

getFunction()

取得特定函式的詳細資料。

createFunction()

目前,InsForge 僅支援在 Deno 環境中執行的 JavaScript/TypeScript 函式。
建立新函式。

updateFunction()

更新現有函式。

deleteFunction()

刪除函式。

錯誤處理


模型參考

FunctionMetadata

FunctionDetails