The runtime-rest-client package provides a JS API to interact with the runtime REST API. It is intended to work with version 0.0.5 of the API.

The main module exposes the mkRestClient function, which returns an instance of a RestClient.

Getting started

The package is released as an ESM module and can be used with a modern bundler or imported directly in the browser (without any bundler) as long as you use an import map.


Instantiating a client requires a runtime URL to the desired network which can either be self hosted with instructions in Marlowe starter kit or through a service such as Demeter.

The caller should run a healthcheck to ensure the runtime service is healthy throughout the lifecycle of the client.

<script src=""></script>
<script type="module">
import { mkRestClient } from "";

let runtimeURL = process.env.MARLOWE_RUNTIME_URL;

const client = mkRestClient(runtimeURL);
const hasValidRuntime = await client.healthcheck();

if (!hasValidRuntime) throw new Error("Invalid Marlowe Runtime instance");