Instalación
Add InsForge to your Swift Package Manager dependencies:Enable Logging (Optional)
For debugging, you can configure the SDK log level and destination:| Level | Description |
|---|---|
.trace | Most verbose, includes all internal details |
.debug | Detailed information for debugging |
.info | General operational information (default) |
.warning | Warnings that don’t prevent operation |
.error | Errors that affect functionality |
.critical | Critical failures |
| Destination | Description |
|---|---|
.console | Standard output (print) |
.osLog | Apple’s unified logging system (recommended for iOS/macOS) |
.none | Disable logging |
.custom | Provide your own LogHandler factory |
Use
.info or .error in production to avoid exposing sensitive data in logs.Actualmente, InsForge solo admite funciones JavaScript/TypeScript ejecutándose en un entorno Deno.
invoke()
Invoca una función sin servidor por slug.Parámetros
slug(String) - Slug/nombre de funciónbody([String: Any], optional) - Cuerpo de solicitud como diccionario
Sobrecargas
El métodoinvoke tiene tres sobrecargas:
-
Con cuerpo de diccionario, devolviendo respuesta tipada
-
Con cuerpo Encodable, devolviendo respuesta tipada
-
Sin esperar cuerpo de respuesta
SDK incluye automáticamente el token de autenticación del usuario conectado.