Skip to main content

Installation

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.
Currently, InsForge only supports JavaScript/TypeScript functions running in a Deno environment.

invoke()

Invoke a serverless function by slug.

Parameters

  • slug (String) - Function slug/name
  • body ([String: Any], optional) - Request body as dictionary

Overloads

The invoke method has three overloads:
  1. With dictionary body, returning typed response
  2. With Encodable body, returning typed response
  3. Without expecting response body
SDK automatically includes authentication token from logged-in user.

Examples

Example: Basic Invocation with Typed Response

Example: With Encodable Request Body


Error Handling