BackendHTTP APIFunctions

Compile a function

Requires an API key with the environment:functions:compile scope. Learn more about API key scopes.

Compiles TypeScript function source code and returns the bundled JavaScript.

POST
/functions/compile

Compiles TypeScript function source code and returns the bundled JavaScript.

Authorization

bearerAuth
headerAuthorizationBearer <token>

An Environment API key from your Tenklo environment, or an Account API key for account-level endpoints.

Request Body

application/json
  1. body
code*string

The TypeScript source code for the function.

Length1 <= length

Response Body

Successfully compiled the function.

application/json
  1. response
bundle_size_bytes*integer
Range0 <= value
bundled_js*string

The bundled JavaScript output.

compiled_at*string
Formatdate-time
Example Request
curl -X POST 'https://api.tenklo.dev/functions/compile' \  -H 'Content-Type: application/json' \  -d '{  "code": "string"}'
Example Response
{  "bundle_size_bytes": 0,  "bundled_js": "string",  "compiled_at": "2019-08-24T14:15:22Z"}