Customjs

Executes custom JavaScript logic, renders HTML into documents, and captures live web snapshots to bridge the gap between raw data and visual assets.

Try Customjs in Ceven

Ask Ceven anything
Standard

Why use Ceven?

  1. AI native Customjs integration

    • Describe the outcome and Ceven picks the right Customjs calls, fills the parameters, and checks the result.
    • Structured, agent friendly tool schemas so each call runs reliably instead of by guesswork.
    • Rich coverage for reading, writing, and querying your Customjs data, across all 5 of its actions.
  2. Managed auth

    • Built in OAuth with automatic token refresh and rotation.
    • One place to manage, scope, and revoke Customjs access.
    • Per user and per environment credentials instead of shared keys.
  3. Agent optimized design

    • Actions are tuned from real success and error rates so reliability climbs over time.
    • Full execution logs so you always know what ran in Customjs, when, and on whose behalf.
    • The agent pauses and asks when Customjs is unclear instead of plowing ahead.
  4. Enterprise grade security

    • Fine grained access so you control which agents and people can reach Customjs.
    • Least privilege by default, read scopes first and only the writes a workflow needs.
    • A full audit trail of every Customjs action to support review and sign off.

Supported tools

Every action Ceven's agents can run on Customjs, and when to use it.

Convert HTML to PDF
Use this when you need to turn raw HTML markup into a downloadable PDF document for invoices or reports.
Convert HTML to PNG
Use this to render an HTML string as a PNG image for social shares or email banners.
Capture webpage screenshot
Pull a visual snapshot of a live URL to verify page layout or archive content.
Merge PDFs
Combine multiple PDF URLs into one single file. Use this for assembling multi page contracts.
Run Puppeteer script
Execute a custom headless browser script to perform complex interactions and return a PNG screenshot.
Authenticate API
Verify a CustomJS API key before initiating a series of rendering or scripting requests.
Authenticate CustomJS API Key
Tool to authenticate a CustomJS API key. Use when verifying a user's API key before making further requests.
Merge multiple PDFs into one
Tool to merge multiple PDF files into a single PDF. Use when you have multiple PDF URLs and want one combined PDF.

8 actions · scroll to see them all

Frequently asked questions

When the agent calls the PDF conversion tool, CustomJS returns the document as raw bytes. Ceven does not store these bytes permanently in the prompt context because they are too large. Instead, the agent immediately streams those bytes to your chosen destination, such as an AWS S3 bucket, a Google Drive folder, or directly into a Slack message as a file upload. If you need to merge multiple files, the agent coordinates the sequence by sending the required URLs to CustomJS and then handling the final combined output in the same manner. This ensures your workflow remains fast and does not hit token limits while processing heavy visual assets.
You can run standard Puppeteer commands to navigate pages, click elements, and take screenshots. However, CustomJS operates in a sandboxed environment for security reasons. This means you cannot access the underlying server file system or perform low level network operations that bypass the browser. The agent writes the script logic based on your prompt and sends it to the CustomJS execution engine. If the script takes too long to execute or attempts to access a forbidden resource, CustomJS will return an error. The agent will then attempt to refine the script logic to fit within the sandbox constraints before trying the execution again.
CustomJS has specific payload limits depending on your account tier. For most users, HTML strings up to several megabytes are processed without issue. If you attempt to render an extremely large HTML document with thousands of embedded images, you may encounter a timeout or a 413 Request Entity Too Large error. To avoid this, the Ceven agent is programmed to suggest splitting large documents into smaller chunks, converting them individually, and then using the merge tool to combine them into one final PDF. This approach ensures reliability and avoids hitting the hard limits of the CustomJS rendering engine during high volume runs.
The basic screenshot tool captures the page as it loads. If a cookie banner or a popup blocks the view, it will appear in the final image. To get a clean shot, you should use the Run Puppeteer Script action. This allows the agent to write a script that explicitly finds the close button for the popup, clicks it, and waits for the element to disappear before triggering the screenshot command. This provides a much more professional result for archival purposes or client reports. The agent handles the selector logic automatically by analyzing the page structure if you provide the target URL first.
Yes. The screenshot tool requires a live URL and captures what is currently hosted on the web. The HTML to PNG tool takes a raw string of HTML and CSS and renders it from scratch. This is ideal for creating dynamic images like personalized certificates or social media open graph images where the content changes for every user. You provide the data and the template, and CustomJS renders the pixels without needing to host a public page. This keeps your internal data private since the rendering happens in a secure environment and the resulting image is sent directly back to the Ceven workflow.
While CustomJS is primarily focused on visual outputs like PDFs and PNGs, the Puppeteer tool can be used to extract text. The agent can write a script to navigate to a page, select specific CSS selectors, and return the inner text of those elements. However, because the tool is optimized for visual snapshots, the primary output is often a screenshot. If you need structured data, the agent will attempt to parse the page and return the text in the response. For very large scale scraping, we recommend a dedicated scraping tool, but for occasional a few page lookups, CustomJS works perfectly.
Ceven uses your CustomJS API key to authenticate every request. You enter your key in the integration settings, and it is stored using AES 256 encryption. Every time the agent needs to render a PDF or take a screenshot, it attaches this key to the request header. Because CustomJS uses a simple API key model rather than OAuth, the connection is nearly instant. You can rotate your key in the CustomJS dashboard at any time. If the key is changed, the agent will receive a 401 Unauthorized error, and Ceven will immediately notify you to update the credentials in the connection panel.
The merge tool requires all provided PDF URLs to be publicly accessible or accessible via the provided headers. If one of the URLs returns a 404 or 500 error, the CustomJS API will fail the entire merge request. To prevent this, the Ceven agent performs a pre flight check by attempting to ping each URL before sending the list to CustomJS. If a broken link is found, the agent will alert you and ask if you want to skip that specific file or provide a replacement link. This prevents the workflow from crashing and ensures the final merged document is complete and accurate.

Alternatives to Customjs

Other tools that solve a similar problem. Ceven supports these too, so you can switch or run more than one at once.

Try Ceven on your stack

Plug Ceven on top of the tools you already run. Connect Customjs and the rest of your stack, describe the outcome, and its agents handle the work end to end, days of it in minutes.

Get started for free