Skip to main content
POST
/
functions
/
compile
Compile a function
curl --request POST \
  --url https://api.nango.dev/functions/compile \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "<string>"
}
'
{
  "bundle_size_bytes": 1,
  "bundled_js": "<string>",
  "compiled_at": "2023-11-07T05:31:56Z"
}
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.

Authorizations

Authorization
string
header
required

The secret key from your Nango environment.

Body

application/json
code
string
required

The TypeScript source code for the function.

Minimum string length: 1

Response

Successfully compiled the function.

bundle_size_bytes
integer
required
Required range: x >= 0
bundled_js
string
required

The bundled JavaScript output.

compiled_at
string<date-time>
required