Skip to content

TypeScript SDK

The SDK does two things. run runs a script and gives you its result in one call, however long it takes. And every API operation is a typed method, so your editor knows each field and answer.

Terminal window
npm install @reminix/sdk

Set REMINIX_API_KEY to a key from API keys in the app.

import { createClient } from "@reminix/sdk";
const reminix = createClient(); // reads REMINIX_API_KEY
const run = await reminix.run("monthly-report", { month: "2026-09" });
console.log(run.output);

run answers when the script has finished:

  • A long run keeps going after the call. run checks on it until it ends.
  • A run that needs a person’s approval waits for them. Pass onApproval to show them where to approve it: reminix.run(slug, inputs, { onApproval: (url) => notify(url) }).
  • A run that fails, or whose approval is turned down, throws a RunError. Its run has the status and the error.
  • To get the run back at once instead, pass { wait: false }.
  • To make calling again safe, such as from a job that reruns, pass { idempotencyKey }. The same key and inputs answer with the first run instead of starting another.

Give a file input as a Blob, a File, or { name, type, data }. The SDK uploads it first and passes its id. Here the monthly report takes an optional CSV file of manual adjustments, and writes the report as a CSV file:

import { readFile } from "node:fs/promises";
import { createClient } from "@reminix/sdk";
const reminix = createClient();
const run = await reminix.run("monthly-report", {
month: "2026-09",
adjustments: {
name: "adjustments.csv",
type: "text/csv",
data: await readFile("adjustments.csv"),
},
});
for (const file of run.files ?? []) {
if (file.direction === "out") console.log(file.name, file.downloadUrl);
}

The files a run writes come back in run.files, each with a download link. See Files.

Each API operation is a method, named like its command in the CLI: reminix runs list is reminix.runs.list().

import { createClient } from "@reminix/sdk";
const reminix = createClient();
const { items } = await reminix.scripts.list();
const recent = await reminix.runs.list({
script: "monthly-report",
limit: 10,
});
await reminix.schedules.create("monthly-report", {
name: "First of the month",
cron: "0 8 1 * *",
timezone: "Europe/London",
});
  • Ids in the path are arguments, and everything else is one object.
  • A method returns the response’s data. A failure throws an ApiError with the error’s code, message, status and requestId.
  • Every write sends an idempotency key, and a failed attempt (a network error, a 5xx, a 429) is retried with the same key, so it happens once. To make your own retry safe too, pass your key as the last argument: reminix.runs.create(slug, { inputs }, { idempotencyKey: id }).

Every method, linked to its fields and a full example under Endpoints:

Scripts

MethodWhat it does
reminix.scripts.archive()Archive a script
reminix.scripts.create()Create a script
reminix.scripts.get()Get a script
reminix.scripts.list()List scripts
reminix.scripts.restore()Restore an archived script
reminix.scripts.update()Change a script

Runs

MethodWhat it does
reminix.runs.cancel()Cancel a run
reminix.runs.create()Run a script
reminix.runs.get()Get a run
reminix.runs.list()List runs
reminix.runs.logs()Get a run's log

Versions

MethodWhat it does
reminix.scriptVersions.create()Upload a version
reminix.scriptVersions.list()List a script's versions
reminix.scriptVersions.publish()Publish a version
reminix.scriptVersions.run()Test-run a version

Schedules

MethodWhat it does
reminix.schedules.create()Schedule a script
reminix.schedules.delete()Delete a schedule
reminix.schedules.list()List a script's schedules
reminix.schedules.update()Change a schedule

Triggers

MethodWhat it does
reminix.triggers.create()Run a script on an event
reminix.triggers.delete()Delete a trigger
reminix.triggers.list()List a script's triggers
reminix.triggers.update()Change a trigger

Files

MethodWhat it does
reminix.files.download()Download a file
reminix.files.get()Get a file
reminix.files.list()List files
reminix.files.upload()Upload a file

Environments

MethodWhat it does
reminix.environments.create()Add an environment
reminix.environments.delete()Delete an environment
reminix.environments.get()Get an environment
reminix.environments.list()List environments
reminix.environments.update()Change an environment

Secrets

MethodWhat it does
reminix.secrets.delete()Delete a secret
reminix.secrets.list()List secrets
reminix.secrets.set()Save a secret
reminix.secrets.unset()Remove a secret's value from an environment

Script settings

MethodWhat it does
reminix.scriptSettings.get()Get the workspace's script settings
reminix.scriptSettings.update()Change the workspace's script settings

Workspace

MethodWhat it does
reminix.workspace.get()Get the current workspace
reminix.workspace.invitations.list()List pending invitations
reminix.workspace.members.list()List workspace members
reminix.workspace.teams.list()List teams
reminix.workspace.usage()Get your plan's usage this period

Webhooks

MethodWhat it does
reminix.workspace.eventTypes.list()List event types
reminix.workspace.webhookDeliveries.list()List an endpoint's deliveries
reminix.workspace.webhookDeliveries.redeliver()Redeliver an event
reminix.workspace.webhookEndpoints.create()Add a webhook endpoint
reminix.workspace.webhookEndpoints.delete()Remove a webhook endpoint
reminix.workspace.webhookEndpoints.enable()Re-enable a webhook endpoint
reminix.workspace.webhookEndpoints.get()Get a webhook endpoint
reminix.workspace.webhookEndpoints.list()List webhook endpoints
reminix.workspace.webhookEndpoints.test()Send a test event

Approvals

MethodWhat it does
reminix.workspace.approvalActions.list()List the actions you can ask approval for
reminix.workspace.approvalRequests.create()Ask a person to approve an action
reminix.workspace.approvalRequests.get()Check an approval request
reminix.workspace.approvalRequests.redeem()Redeem an approved request

Audit events

MethodWhat it does
reminix.workspace.auditEvents.list()List workspace audit events

Personal access tokens

MethodWhat it does
reminix.user.me()Get the current user
reminix.user.revokeToken()Revoke the token making this request
  • createClient() reads your key from the REMINIX_API_KEY environment variable. Without it, it throws an error naming the variable. Where there’s no process.env, such as a browser or a Cloudflare Worker, pass the key: createClient({ token: env.REMINIX_API_KEY }).
  • With an API key, every call acts in the key’s workspace.
  • With a personal access token, name the workspace: createClient({ token, workspace: "acme" }).

reminix.GET, reminix.POST and the other HTTP methods call any path, with the same types. They return { data, error, response } instead of throwing, and unwrap turns that into the data or an ApiError.