Implementing services in JavaScript

Cloudstate offers a straightforward JavaScript API for implementing Cloudstate services. Before you attempt to write your first service in JavaScript, we recommend that you work through the Tutorial

Prerequisites

The following are required to start writing Cloudstate services in JavaScript:

Node

Cloudstate uses the grpc node packagenew tab, which compiles a native gRPC implementation using node-gyp. It requires a minimum node version of 6.14.3.

protoc

Cloudstate requires using the protoc compiler to serialize your protobuf definitions into the protobuf binary descriptor format. We provide helper scripts to automatically download the protoc compiler for your platform and do this compilation.

docker

You will need Docker to build a container that you can deploy to Akka Serverless. You can publish the container to a variety of registries.

Install Cloudstate libraries

Once you have the prerequisites, you need to add the cloudstate package to your project, which can be done by running:

npm install cloudstate --save

What’s next