Overview
What are modules?
Modules are pieces of backend functionality that can be combined together to build & customize your game's backend.
Modules include:
- Scripts that implement the logic.
- Database schemas to store persistent data.
- User configuration to let you configure settings on the module.
- Explicit errors to make it easy to understand & recover from errors returned from the module.
You can think of modules like an NPM package/Unity package/Unreal plugin/Maven artifact/Rust crate but with a persistence layer and a standard + well-documented way of using it.
How do I install modules?
To install a module from the default registry, you have two options.
CLI
You can install the module from the CLI by running the following command:
This will update your rivet.json
file accordingly.
rivet.json
You can also manually add the module to your rivet.json
file manually, like this:
Registries
Modules come from registries. Rivet provides a default registry with all of the modules available on this website. You can specify or host your own registries easily. Read more here.
Quickstart
Install Rivet CLI
Install latest version
Install specific version
We recommend specifying the CLI version in CI environments. This also allows you to install prerelease versions of the CLI.
The export
keyword is important. The variable RIVET_CLI_VERSION
needs to be accessible inside the install script.
Create project
Create a new project by running the following command:
This creates a rivet.json
config file. See the project configuration here.
Add modules
The default project comes with a set of modules preinstalled. For example, install the friends
module by running the following command:
This adds the friends
module to the rivet.json
file. You can also install modules manually by adding them to this config.
See a list of available modules here.
Run development server
The development server is great for testing your scripts locally. This will build & run your backend locally & hot reload when you make changes to the configuration.
Deploy server (optional)
Install the Rivet CLI, then run the following: