Rivet provides a fully managed cloud service for running ActorCore, with automatic scaling, global deployment, and built-in monitoring.

ActorCore is still pre-v1.0. Please help us by report bugs on GitHub Issues!

Deploy

1

Start with framework

Start with your framework of choice:

2

Install dependencies

Install the Rivet platform package:

npm install @actor-core/rivet
3

Deploy to production

Deploy your ActorCore application to Rivet:

npx @actor-core/cli@latest deploy rivet actors/app.ts

This will:

  1. Prompt you to log in to Rivet if needed

  2. Ask you to select or create a Rivet project

  3. Build and deploy your application

  4. Provide you with your new endpoint

    Update your client code with the new endpoint URL and test your deployed application.

4

Update your client's endpoint

Update your client to connect to your deployed app:

const client = createClient<App>(/* FILL ME IN */);

CORS Configuration

For security reasons, you should configure proper CORS settings in production. In the example above, we used cors: { origin: "*" } which allows requests from any domain.

For production deployments, specify the exact domains that should be allowed to connect to your actors. Learn more in the CORS documentation.

Integration with Existing Projects

If you already have an existing application and want to mount ActorCore on a subpath, see our Hono integration guide. Remember to specify the same path in config.basePath as where you mount the router.

Accessing Rivet Context

Rivet’s ActorContext can be accessed from createVars.

import { actor } from "actor-core";

const myActor = actor({
  // Load Rivet-specific variables
  createVars: (c, rivet) => ({
    rivet: rivet.ctx,
  }),
  actions: {
    foo: async (c) => {
      // Access ActorContext
      c.log.info(`Region: ${c.vars.rivet.metadata.region.name}`);
      await c.vars.rivet.kv.get("foo");
    },
  }
});

Available Regions

Rivet supports deploying your actors to multiple regions automatically. You can specify region preferences in your Rivet project settings in the Rivet Hub.

See available regions here.

Next Steps