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

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

FieldTypeDescription
languagestringtypescript
runtimestringThe Node.js version the code runs on
packagesarrayThe packages the code can import, with name and a short description
limitsobjectThe limits, with the fields of Get usage
templatestringThe code a function created without source starts with
typesDtsstringThe TypeScript types of @platica/functions

Errors

Statusdetails.codeWhen
403FORBIDDENThe person behind the token does not have access to Integrations

Notes

  • Platica extends the package list; you cannot add others.
  • You can store typesDts in your repository so your editor checks the code before you verify it.