Sign In
Getting Started

Initial Setup

This guide will walk you through:

  1. Initializing a new project
  2. Deploying a Rivet Actor
  3. Setting up the Rivet client SDK

If you get stuck at any point, you can read the troubleshooting guide, ask a question on Discord/GitHub Discussion, or file a bug report on GitHub Issues.

Install CLI

The easiest way to get start with Rivet is to use the CLI. Run this command to install Rivet on your system:

curl -fsSL https://releases.rivet.gg/rivet/latest/install.sh | sh
Command Line

Initialize project & login to Rivet

Once you've installed the Rivet CLI, run this command in your project root to create a new project:

rivet init
Command Line

Follow the instructions to initialize your project & login to Rivet.

Deploy project

After initializing your project, now you will deploy your actor to Rivet's servers.

Run the following command, and replace my-app with the name of your project:

cd my-app
rivet deploy
Command Line

If self-hosting, this will prompt you to input a custom API address.

Once complete, visit the Rivet Hub to see the build you uploaded:

Build list

Create a test actor

Now that you've uploaded a build to Rivet, we need to create an actor using that build.

To test the actor can be created & connected to, run:

rivet deno run -A counter_test.ts
Command Line

Once complete, visit the Rivet Hub to see the actor you created:

Actor list

Setup client SDK

Now that you have an actor deployed, integrate the Rivet client SDK with your actor.

Install the package for your language:

Once installed, we need to find the endpoint that your actors connect to. Run this command in your project:

rivet manager endpoint
Command Line

Use this code to create & connect to the actor. Replace /* CONNECTION ADDRESS */ with the value from the previous step.

import { Client } from '@rivet-gg/actor-client';
const client = new Client(/* CONNECTION ADDRESS */);

const counter = await client.get({ name: 'counter' }); // Get or create a `counter` actor
const newCount = await counter.increment(5); // Call the method `increment` on the `counter` actor
console.log('New count', newCount);
TypeScript

Visit the Rivet Hub to see the actor you created.

Setup your editor/IDE (optional)

Rivet actors run on the Deno runtime. Read their guide on how to configure your IDE here.


Next steps

Suggest changes to this page