Node.js & Bun
The RivetKit JavaScript client allows you to connect to and interact with actors from browser and Node.js applications.
Quickstart
1
Create a new Node.js project
Create a new Node.js project with TypeScript support:
2
Install RivetKit packages
Install the RivetKit client and Node.js platform packages:
3
Create your client
Create a file src/client.ts
in your project to connect to your actor:
src/client.ts
4
Run your client
In a separate terminal, run your client code:
You should see output like:
Run it again to see the state update.
Next Steps
For more information on communicating with actors, including event handling and RPC calls, see Communicating with Actors.