Sign In
Getting Started

TypeScript Quick Start Guide

In this guide, you'll learn how to set up a TypeScript actor project powered by the ActorCore framework, deploy it to Rivet, and connect to it from a client.

Create and explore your project

Use the command below to create a new actor project:

npx create-actor@latest -p rivet -t counter

During setup, you'll be prompted to specify a project directory.

Once setup completes, you'll have a project with:

  • actor.config.ts: Actor configuration
  • src/index.ts: Main actor implementation
  • tests/client.ts: Client test script

The counter template provides a simple actor that maintains a numeric state and exposes methods to increment it.

Deploy to Rivet

Deploy your actor with:

cd your-project
npm run deploy
Command Line

You'll be guided through:

  1. Logging in to your Rivet account (or creating one)
  2. Creating a new project (if needed)
  3. Selecting an environment

After deployment completes, you'll receive:

  • Actor Core: Your endpoint for client connections
  • Links to the Rivet Hub for monitoring and management

Connect to your actor

Update the tests/client.ts file with your deployment URL:

// Replace with your Actor Core URL from the deployment output
const client = new Client("https://your-actor-manager-url.rivet.run:443");
TypeScript

Run the test client:

npx tsx tests/client.ts
Command Line

You should see output similar to:

Event: 1
RPC: 1

Run it again to see the actor state increment as it persists between calls.

Monitor your deployment

Visit the Rivet Hub to:

  • Monitor your actors in real-time
  • Check logs and debug issues
Rivet Dashboard
Suggest changes to this page