npm.io
1.15.1 • Published 2d ago

@restatedev/restate-sdk-clients

Licence
MIT
Version
1.15.1
Deps
1
Size
115 kB
Vulns
0
Weekly
108.7K
Stars
109

Documentation Examples NPM Version Discord Twitter

Restate Typescript SDK Clients

Restate is a system for easily building resilient applications using distributed durable async/await.

This package contains the clients to interact with your Restate services, using fetch.

import * as restate from "@restatedev/restate-sdk-clients";

// Import the type of the service to call
import type { Greeter } from "./greeter-service";
const Greeter: Greeter = { name: "greeter" };

// Instantiate the Restate client
const rs = restate.connect({ url: "http://localhost:8080" });

// Get a typed client for Greeter
const greeter = rs.serviceClient(Greeter);

// Send a request to greet
const greeting = await greeter.greet(name);

To build Restate services using Typescript, checkout the SDK main package https://www.npmjs.com/package/@restatedev/restate-sdk.

Community

Using the Restate client

To use this client, add the dependency to your project:

npm install @restatedev/restate-sdk-clients

Versions

This library follows Semantic Versioning.