Get the environment
SDK platic.tools.functions.runtime()
Read the language, allowed packages, limits, starter template, and @platica/functions types. Use them before writing a function, or share them with your coding assistant to use the correct signatures.
Example
curl "https://api.platic.ai/v1/tools/functions/runtime" \
-H "Authorization: Bearer $PLATIC_API_KEY" await platic.tools.functions.runtime(); Response
{
"status": "success",
"data": {
"language": "typescript",
"runtime": "nodejs22.x",
"packages": [
{ "name": "@platica/functions", "description": "defineFunction, http, secrets, log" },
{ "name": "zod", "description": "Esquema de entrada (obligatorio)" },
{ "name": "fast-xml-parser", "description": "Leer y construir XML / SOAP" },
{ "name": "date-fns", "description": "Fechas" },
{ "name": "decimal.js", "description": "Aritmética decimal exacta (dinero)" },
{ "name": "papaparse", "description": "CSV" },
{ "name": "lodash-es", "description": "Utilidades de colecciones" }
],
"limits": { "functionsPerWorkspace": 20, "timeoutSeconds": { "min": 1, "max": 60, "default": 20 }, "memoryMb": 256 },
"template": "import { z } from \"zod\";\nimport { defineFunction } from \"@platica/functions\";\n\nexport default defineFunction({ … });\n",
"typesDts": "declare module \"@platica/functions\" { … }"
}
} limits, template and typesDts are trimmed in the example. The package descriptions come in Spanish.
Response fields
| Field | Type | Description |
|---|---|---|
language | string | typescript |
runtime | string | The Node.js version the code runs on |
packages | array | The packages the code can import, with name and a short description |
limits | object | The limits, with the fields of Get usage |
template | string | The code a function created without source starts with |
typesDts | string | The TypeScript types of @platica/functions |
Errors
| Status | details.code | When |
|---|---|---|
403 | FORBIDDEN | The person behind the token does not have access to Integrations |
Notes
- Platica extends the package list; you cannot add others.
- You can store
typesDtsin your repository so your editor checks the code before you verify it.