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 |
How it works
Section titled “How it works”- The SDK starts
runwisp daemon --appand gives it your tasks as its config: one[tasks.*]entry per task, withsdkset. There is norunwisp.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 arunwisp.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.
Next to a RunWisp you already run
Section titled “Next to a RunWisp you already run”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.