Skip to main content

安裝

Add InsForge to your Swift Package Manager dependencies:

Enable Logging (Optional)

For debugging, you can configure the SDK log level and destination:
Log Levels: Log Destinations:
Use .info or .error in production to avoid exposing sensitive data in logs.
目前,InsForge 僅支援在 Deno 環境中執行的 JavaScript/TypeScript 函數。

invoke()

按 slug 叫用無伺服器函數。

參數

  • slug (String) - 函數 slug/名稱
  • body ([String: Any], optional) - 要求主體作為字典

多載

invoke 方法有三個多載:
  1. 使用字典主體,傳回類型化回應
  2. 使用 Encodable 主體,傳回類型化回應
  3. 不期望回應主體
SDK 會自動包含來自登入使用者的驗證令牌。

範例

範例:基本叫用與類型化回應

範例:使用 Encodable 要求主體


錯誤處理