https://github.com/restatedev/sdk-typescript
Restate SDK for JavaScript/Typescript
https://github.com/restatedev/sdk-typescript
Last synced: 5 months ago
JSON representation
Restate SDK for JavaScript/Typescript
- Host: GitHub
- URL: https://github.com/restatedev/sdk-typescript
- Owner: restatedev
- License: mit
- Created: 2023-02-28T13:56:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-02-19T22:31:08.000Z (5 months ago)
- Last Synced: 2026-02-20T02:57:50.648Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 14.2 MB
- Stars: 92
- Watchers: 25
- Forks: 16
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
[](https://docs.restate.dev)
[](https://github.com/restatedev/examples)
[](https://www.npmjs.com/package/@restatedev/restate-sdk)
[](https://discord.gg/skW3AZ6uGd)
[](https://twitter.com/intent/follow?screen_name=restatedev)
# Restate Typescript SDK
[Restate](https://restate.dev/) is a system for easily building resilient applications using *distributed durable async/await*. This repository contains the Restate SDK for writing services in **Node.js / Typescript**.
Restate applications are composed of *durably executed, stateful RPC handlers* that can run either
as part of long-running processes, or as FaaS (AWS Lambda).
```typescript
import * as restate from "@restatedev/restate-sdk";
const greeter = restate.service({
name: "greeter",
handlers: {
greet: async (ctx: restate.Context, name: string) => {
return `Hello ${name}!`;
},
},
});
restate.serve({ services: [greeter], port: 9080 });
```
## Community
* π€οΈ [Join our online community](https://discord.gg/skW3AZ6uGd) for help, sharing feedback and talking to the community.
* π [Check out our documentation](https://docs.restate.dev) to get quickly started!
* π£ [Follow us on Twitter](https://twitter.com/restatedev) for staying up to date.
* π [Create a GitHub issue](https://github.com/restatedev/sdk-typescript/issues) for requesting a new feature or reporting a problem.
* π [Visit our GitHub org](https://github.com/restatedev) for exploring other repositories.
## Using the SDK
Prerequisites:
- [NodeJS](https://nodejs.org/en/) >= v20.19 or [Bun](https://bun.sh/docs/installation) or [Deno](https://deno.land/#installation)
- [npm CLI](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) >= 9.6.7
To use this SDK, add the dependency to your project:
```shell
npm install @restatedev/restate-sdk
```
For brand-new projects, we recommend using the [Restate Node Template](https://github.com/restatedev/node-template-generator):
```shell
npx -y @restatedev/create-app@latest
```
Check the [Quickstart](https://docs.restate.dev/get_started/quickstart) for more info.
## Versions
This library follows [Semantic Versioning](https://semver.org/).
The compatibility with Restate is described in the following table:
| Restate Server\sdk-typescript | <= 1.4 | 1.5 - 1.6 | 1.7 - 1.8 | 1.9 - 1.10 |
|-------------------------------|------------------|-----------|------------------|------------------|
| <= 1.2 | β
| β | β | β |
| 1.3 | β
| β
| β
(1) | β
(2) |
| 1.4 | β
| β
| β
| β
(2) |
| 1.5 | β (3) | β
| β
| β
|
(1) **Note** the new `options` in service/object/workflow constructors, together with some of the new options in the `handler`s too, work only from Restate 1.4 onward. Check the in-code documentation for more details.
(2) **Note** the new `options.retryPolicy` work only from Restate 1.5 onward. Check the in-code documentation for more details.
(3) **Warning** SDK versions <= 1.4 are deprecated, and cannot be registered anymore. Check the [Restate 1.5 release notes](https://github.com/restatedev/restate/releases/tag/v1.5.0) for more info.
## Contributing
Weβre excited if you join the Restate community and start contributing!
Whether it is feature requests, bug reports, ideas & feedback or PRs, we appreciate any and all contributions.
We know that your time is precious and, therefore, deeply value any effort to contribute!
For more info about developing the SDK, check the [development guide](DEVELOPMENT.md).