Skip to main content
Use CustomJS through Corsair: one client, typed API calls. Get the key from app.customjs.space: sign in, then copy the value under API Key on the dashboard. The free plan allows 20 renders and script runs a day (page calls are not counted). Things to know before you call:
  • An exhausted window answers 403, not 429. The body is {"message":"Too Many Requests"}, so the plugin classifies a 403 by its body: a wrong key and an exhausted window share the status. On the free plan that 403 means the day’s quota is used up and carries no reset time, so the plugin reports CustomjsAPIError with isRateLimit at once instead of retrying. A 429, or a 403 with Retry-After, is retried up to three times.
  • Files come back base64 encoded. pdf.fromHtml, pdf.fromMarkdown, screenshot.capture and javascript.runBinary return { base64, contentType, byteLength }. Decode base64 to write a file.
  • javascript.run returns text, not parsed JSON. The route answers text/plain whatever the script returns, so an object arrives JSON encoded in output and a script with no return arrives empty.
  • Missing required fields render blank files. CustomJS answers 200 with an empty PDF or PNG when html or url is absent, so the input schema requires them.
  • scrape.agent bills model tokens. It drives a browser for up to maxSteps actions and returns its token usage. scrape.page runs your exact steps and spends none.
  • Page names are not unique. pages.create publishes a new page every call, even with a name that already exists, so a retry duplicates it and the plugin never replays that call. pages.delete fails with a 404 for a page ID that does not exist.
  • Stored functions are not wrapped. The docs describe calling a saved script by ID; the route answered 500 with every ID tried, so this plugin only runs code inline.
What you get:
  • 12 typed API operations

Setup

1

Install

2

Add the plugin

corsair.ts
With multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.
3

Choose authentication

4

Connect a tenant

Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.

Example API calls

Render HTML to PDF
Publish a page
See the full list on the API page.

What’s next

API reference

Every customjs.api.* operation with input and output types.

Connect / OAuth

createLink, Hub delivery, and tenant connect flows.

Use with agents

Expose this plugin’s operations as MCP tools.