SDK Generation

Rivet generates a unique SDK for your modules with type-safe methods to call your scripts automatically. This SDK configuration can be found in the sdk portion of your rivet.json.


Setup

Godot

The Rivet plugin automatically configures SDK generation for you. The SDK is automatically available to you on the Rivet singleton.

The backend endpoint is automatically populated for you.

Unity

The Rivet plugin automatically configures SDK generation for you.

The SDK an be access using the Rivet.RivetClient object:

var config = new Configuration();
var client = new BackendClient(config.BackendEndpoint);
C#

The backend endpoint is automatically populated for you.

JavaScript & TypeScript

Install SDK

Replace ./path/to/sdk with the path to the generated SDK.

npm install ./path/to/sdk
yarn add ./path/to/sdk

Initiate SDK

import { Rivet } from "rivet-sdk";
const rivet = new Rivet({});
TypeScript

Call script

const data = await backend.callUsersGetUser({ userIds });
console.log("Users", data.users);
TypeScript