temporal-http-client

0.0.8 • Public • Published

Temporal HTTP Client

Nota bene: This is currently experimental.

Provides a typesafe API client for Temporal's HTTP API. This is primarily intended for use in Temporal's UI.

Updating the Schema

  • Using npm: npm run generate
  • Using pnpm: pnpm generate

This will download Temporal's API repository, generate types based on the OpenAPI specification, and write the types to src/schema.d.ts.

It will also create a client class in src/client.ts.

Usage

import { Client } from 'temporal-http-client';

const client = new Client({ baseUrl: 'http://localhost:8233' });

const response = await client.listNamespaces();

response.data?.namespaces?.forEach((namespace) => {
  console.log(namespace);
});

if (response.error) {
  console.error(response.error.code, response.error.message);
}

Readme

Keywords

none

Package Sidebar

Install

npm i temporal-http-client

Weekly Downloads

124

Version

0.0.8

License

none

Unpacked Size

101 kB

Total Files

8

Last publish

Collaborators

  • stevekinney