A JS library for interfacing with Complement's homerunner application.
  • TypeScript 99%
  • JavaScript 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Will Hunt ea8410ecd0 1.1.0
2024-11-28 13:20:44 +00:00
src Add new homerunner options. 2024-11-28 13:09:28 +00:00
tests Update linting 2024-11-28 13:09:13 +00:00
.eslintrc Update linting 2024-11-28 13:09:13 +00:00
.gitignore update ignores 2022-07-01 14:12:17 +01:00
.npmignore update ignores 2022-07-01 14:12:17 +01:00
jest.config.js linting and tests 2022-06-28 23:23:35 +01:00
package.json 1.1.0 2024-11-28 13:20:44 +00:00
README.md add usage 2022-06-28 22:35:39 +01:00
tsconfig.json Update linting 2024-11-28 13:09:13 +00:00
tsconfig.lint.json Update linting 2024-11-28 13:09:13 +00:00
yarn.lock Update depdendencies 2023-12-22 12:37:14 +00:00

homerunner-client

A JS library for interfacing with Complement's homerunner application.

See matrix-org/complement for details on how that works.

The library is environment variable aware, and will use the following URLs in order when communicating with homerunner:

  1. The URL provided to Homerunner.Client in the constructor.
  2. HOMERUNNER_URL, if provided as an environment variable.
  3. http://localhost:{process.env.HOMERUNNER_PORT}, if HOMERUNNER_PORT is provided as an environment variable.
  4. http://localhost:54321

Usage

You can install the package with npm install homerunner-client or yarn add homerunner-client.

Example

Below is a simple example of how to use the library. Consult the type definitions for more advanced usage.

const client = new Homerunner.Client();

const blueprint1 = await client.create("my-blueprint");
// or
const blueprint2 = await client.create({
	base_image_uri: "complement-dendrite",
	blueprint: {
		Name: "my-custom-blueprint",
		Homeservers: [{
			Name: "hs1",
			Users: [{
				Localpart: "alice",
				DisplayName: "Alice",
			}]
		}]
	}
});
// or
const blueprint3 = await client.create({
	base_image_uri: "complement-dendrite",
	blueprint_name: "federation_one_to_one_room"
})

// Do some testing....

await client.destroy("my-blueprint");
await client.destroy("my-custom-blueprint");
await client.destroy("federation_one_to_one_room");