Skip to content

SDKs

since: 1.7

An SDK lets you define tasks in your app’s code instead of runwisp.toml. Your callbacks run inside your app. RunWisp schedules them and records every run with its output, exit code and duration, in the same web UI, TUI and CLI as any other task.

Language Package Guide
JavaScript @runwisp/js JavaScript SDK
  • The SDK starts runwisp daemon --app and gives it your tasks as its config: one [tasks.*] entry per task, with sdk set. There is no runwisp.toml. When your tasks change, the SDK sends the new config and RunWisp applies it like a reload.
  • When a task fires, RunWisp asks the app to run its callback. What the callback prints becomes the run’s log, and a thrown error fails the run.
  • Task options are [tasks.*] keys with the same names, so the configuration reference applies as is. The rest of a runwisp.toml, such as notifiers and routes, goes in the SDK’s config option.
  • Several copies of the app that share a data directory share one daemon. Each run happens once, in one of the copies. The daemon stops when the last copy is gone.

The SDK starts its own daemon, with its own data directory, web UI and password. It doesn’t add tasks to a daemon that runs your runwisp.toml, and refuses a data directory that such a daemon uses. If the default port (9477) is taken, the SDK uses the next free one.

SDKs run on Linux, macOS and WSL, like RunWisp itself.