跳转到主要内容

安装

  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