安装
Add InsForge to your Swift Package Manager dependencies:Enable Logging (Optional)
For debugging, you can configure the SDK log level and destination:
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 方法有三个重载:
-
使用字典体,返回类型化响应
-
使用 Encodable 体,返回类型化响应
-
不期望响应体
SDK 自动包含来自登录用户的身份验证令牌。