Skip to main content

Installation

Find the anon key with npx @insforge/cli secrets get ANON_KEY, or in the dashboard: click Install and open API Keys.

invoke()

Invoke a serverless function by slug.

Parameters

  • slug (string, required) - Function slug/name
  • body (any, optional) - Request body (JSON-serializable)
  • headers (object, optional) - Custom headers
  • method (‘GET’ | ‘POST’ | ‘PUT’ | ‘PATCH’ | ‘DELETE’, optional) - HTTP method (default: POST)

Returns

SDK automatically includes authentication token from logged-in user.

Example (POST with body)

Output (POST with body)

Example (GET request)

Output (GET request)

Example (With custom headers)

Output (With custom headers)

Complete Serverless Function Examples

Example 1: Public Function (No Authentication Required)

Example 2: Authenticated Function (Access User Data)