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
Compiles TypeScript function source code and returns the bundled JavaScript.
bearerAuthheader
AuthorizationBearer <token>An Environment API key from your Tenklo environment, or an Account API key for account-level endpoints.
application/json- body
code*stringThe TypeScript source code for the function.
Length
1 <= lengthSuccessfully compiled the function.
application/json- response
bundle_size_bytes*integerRange
0 <= valuebundled_js*stringThe bundled JavaScript output.
compiled_at*stringFormat
date-timecurl -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"}