@automate.ax/client
v0.115.1
Published
Type-safe client for the Automate.ax API.
Readme
@automate.ax/client
Type-safe client for the public Automate.ax management API.
Install
bun add @automate.ax/clientAPI key
import { createAutomateClient } from "@automate.ax/client"
const client = createAutomateClient({
apiKey: process.env.AUTOMATE_AX_API_KEY!,
})
const firstPage = await client.project.list({ limit: 25 })
for (const project of firstPage.items) {
console.log(project.name)
}
if (firstPage.items[0]) {
const automations = await client.automation.list({
projectId: firstPage.items[0].id,
limit: 25,
})
if (automations.items[0]) {
const automation = await client.automation.get({
automationId: automations.items[0].id,
})
console.log(automation.triggers)
}
}List procedures return { items, pageInfo }. When pageInfo.hasMore is true, pass pageInfo.nextCursor as the next request's cursor.
The key is organization-owned and is sent in the x-api-key header. It does not represent a user session.
The client targets https://automate.ax/api/rpc. Embedded and local callers can override rpcUrl, provide a custom fetch, and add per-request headers:
const client = createAutomateClient({
apiKey: process.env.AUTOMATE_AX_API_KEY!,
rpcUrl: "https://automate.test/api/rpc",
headers: () => ({ "x-request-source": "local-test" }),
})Authentication headers are set after additional headers and cannot be overridden through headers.
Automate.ax action runtimes use the same client with runtimeToken. This mode is for the active execution token supplied by the platform; it is not a replacement for an organization API key in external applications.
User session
User-scoped procedures, including execution-data discovery, use a signed-in user's bearer session:
import { createAutomateClient } from "@automate.ax/client"
const client = createAutomateClient({
sessionToken: process.env.AUTOMATE_SESSION_TOKEN!,
})
const manifest = await client.executionData.manifest({
projectId: "proj_01...",
since: "2026-08-01T00:00:00Z",
})
console.log(manifest.consistency, manifest.resources)Credential callbacks are evaluated before every request, so a client can use a refreshed token without being recreated. Supply exactly one of apiKey, runtimeToken, or sessionToken.
