services

Supported runtimes, the handler contract and invoking a function.

Edge functions

Edge functions are single-file handlers deployed from the console or the API and served by the global runtime.

Runtimes

RuntimeEntry contract
javascript / typescriptexport default async function handler(request)
pythondef handler(request)
gofunc Handler(w, r)
phpfunction handler($request)
rustfn handler(req: Request) -> Response

Invoking

Each function has a stable public URL:

https://api.tngat.com/edge/f/<slug>
bash
curl -X POST https://api.tngat.com/edge/f/checkout \
  -H "Content-Type: application/json" \
  -d '{"cartId": "c_9f2"}'

Versions and rollback

Saving publishes a new version. Previous versions stay addressable, so a failed release is a one-click rollback in Functions → History.

Environment variables

Functions read the variables of the environment the version was deployed to — the same resolution order as applications. Secrets are injected at runtime and never bundled into the artifact.

Cron schedules

A function can run on a schedule — a five-field cron expression (minute, hour, day of month, month, day of week), evaluated in UTC once a minute. Every matching minute the platform invokes the function exactly as an HTTP call would: it is metered as function_invocations, it appears in the invocation logs, and the trigger is carried by an x-tngat-scheduled: 1 header.

Set it with PATCH /api/v1/functions/:id using industry-standard schedule expressions — */15 * * * * runs every quarter hour, 0 9 * * 1-5 runs weekdays at 09:00 UTC, and null removes the schedule. The console shows the last scheduled run and, when a dispatch fails (an unreachable runtime, a dropped function), the reason — a schedule set but not firing is rendered, not hidden. A scheduled run is fired by the platform's own scheduler over an internal, shared-secret route, so it matches even on functions that require a per-function bearer key for public calls — no key needs to be minted or embedded for the schedule to keep firing.