CustomJS lets you run JavaScript natively inside any HTTP request.
You can either pass your JS inline with the request or store reusable functions on the CustomJS platform โ perfect for keeping your logic clean and secure.
๐ Learn more about Inline vs. Stored JavaScript โ
Besides native JS execution, the CustomJS API includes powerful helpers to make automation easier:
These helpers are available in both inline and stored executions.
curl -X POST 'https://e.customjs.io/__js1-YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-H 'customjs-origin: inline/pdf-generator' \
--data-raw '{"input":{"html":"Hello World"},"code":"const { HTML2PDF } = require(\"./utils\"); return HTML2PDF(input.html);","returnBinary":"true"}' \
> customjs-output.pdf