|
| 1 | +[](https://docs.restate.dev) |
| 2 | +[](https://github.com/restatedev/examples) |
| 3 | +[](https://discord.gg/skW3AZ6uGd) |
| 4 | +[](https://twitter.com/intent/follow?screen_name=restatedev) |
| 5 | + |
| 6 | +# Restate Typescript SDK |
| 7 | + |
| 8 | +[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**. |
| 9 | + |
| 10 | +Restate applications are composed of *durably executed, stateful RPC handlers* that can run either |
| 11 | +as part of long-running processes, or as FaaS (AWS Lambda). |
| 12 | + |
| 13 | +```typescript |
| 14 | +import * as restate from "@restatedev/restate-sdk"; |
| 15 | + |
| 16 | +const greeter = restate.service({ |
| 17 | + name: "greeter", |
| 18 | + handlers: { |
| 19 | + greet: async (ctx: restate.Context, name: string) => { |
| 20 | + return `Hello ${name}!`; |
| 21 | + }, |
| 22 | + }, |
| 23 | +}); |
| 24 | + |
| 25 | +restate.endpoint() |
| 26 | + .bind(greeter) |
| 27 | + .listen(9080); |
| 28 | +``` |
| 29 | + |
| 30 | +## Community |
| 31 | + |
| 32 | +* 🤗️ [Join our online community](https://discord.gg/skW3AZ6uGd) for help, sharing feedback and talking to the community. |
| 33 | +* 📖 [Check out our documentation](https://docs.restate.dev) to get quickly started! |
| 34 | +* 📣 [Follow us on Twitter](https://twitter.com/restatedev) for staying up to date. |
| 35 | +* 🙋 [Create a GitHub issue](https://github.com/restatedev/sdk-typescript/issues) for requesting a new feature or reporting a problem. |
| 36 | +* 🏠 [Visit our GitHub org](https://github.com/restatedev) for exploring other repositories. |
| 37 | + |
| 38 | +## Using the SDK |
| 39 | + |
| 40 | +To use this SDK, add the dependency to your project: |
| 41 | +```shell |
| 42 | +npm install @restatedev/restate-sdk |
| 43 | +``` |
| 44 | + |
| 45 | +For brand-new projects, we recommend using the [Restate Node Template](https://github.com/restatedev/node-template-generator): |
| 46 | +```shell |
| 47 | +npx -y @restatedev/create-app@latest |
| 48 | +``` |
0 commit comments