Getting Started with the Native API

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.


Inline vs. Stored JavaScript

  • Inline JavaScript: Send your code directly in the HTTP request body. Ideal for quick tests or dynamic, one-off executions.
  • Stored JavaScript: Save your functions in CustomJS once and reference them by ID. Great for production use, versioning, and sharing logic across multiple workflows.

๐Ÿ‘‰ Learn more about Inline vs. Stored JavaScript โ†’


Core Features

Besides native JS execution, the CustomJS API includes powerful helpers to make automation easier:

  • ๐Ÿงพ HTML to PDF conversion
  • ๐Ÿ“ธ Website Screenshots
  • ๐Ÿค– Web Scraping with browser interaction

These helpers are available in both inline and stored executions.


Quick Setup

  1. Get your API key
    Read how to get your API key โ†’
  2. Choose your execution mode
    Inline vs. Stored JS โ†’
  3. Make your first request
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