Skip to content

HandyS11/RustPlusApi

Repository files navigation

RustPlusApi

A C# library for the Rust+ companion API. Query and control your server, render security cameras, listen for FCM notifications, and acquire all the required credentials natively — no Node.js required.

CI CD Docs

.NET License: MIT codecov Mutation Score

Getting Started · Documentation · Samples

Packages

Package Version Downloads Description
RustPlusApi NuGet Downloads Core client. Typed Response<T> API for info/time/map/markers, team & clan chat, nexus auth, entities (smart switch / alarm / storage monitor), and the camera protocol.
RustPlusApi.Fcm NuGet Downloads FCM listener — receives server/entity pairing and alarm notifications.
RustPlusApi.Fcm.Registration NuGet Downloads Native credential acquisition (GCM/Firebase/FCM/Expo + Steam login + Rust Companion). Replaces the rustplus.js Node CLI.
RustPlusApi.Camera NuGet Downloads Renders camera frames (AppCameraRays) into images via ImageSharp.
RustPlusApi.Extensions.DependencyInjection NuGet Downloads DI registration (AddRustPlus, IRustPlusFactory) for the core client.
RustPlusApi.Fcm.Extensions.DependencyInjection NuGet Downloads DI registration (AddRustPlusFcm, IRustPlusFcmFactory) for the FCM listener.

Versions

skills

Targets .NET Standard 2.0 and .NET 10 — usable from .NET Framework 4.6.2+, .NET 6/7/8/9/10, Mono, and Unity.

Install

dotnet add package RustPlusApi
dotnet add package RustPlusApi.Fcm
dotnet add package RustPlusApi.Fcm.Registration   # native credentials (optional)
dotnet add package RustPlusApi.Camera             # camera rendering (optional)

Quickstart

1. Get your credentials (once). Run the registration sample — it logs you into Steam, writes rustplus.config.json, and prints the RustPlus(...) arguments after you pair in game:

dotnet run --project samples/RustPlus.Register.ConsoleApp

See samples/ for the full walkthrough. (You can still use npx @liamcottle/rustplus.js fcm-register as a fallback.)

2. Talk to the server:

using var rustPlus = new RustPlus(new RustPlusConnection(server, port, playerId, playerToken));
await rustPlus.ConnectAsync();

var info = await rustPlus.GetInfoAsync();
Console.WriteLine(info.Data?.Name);

3. Listen for notifications:

var listener = new RustPlusFcm(credentials);
listener.OnServerPairing += (_, e) => Console.WriteLine($"Paired: {e.Data?.Ip}");
await listener.ConnectAsync();

Documentation

Full guides and the API reference live on the documentation site (built with DocFX). Start with Getting Started, browse the Recipes for common patterns, or check the Troubleshooting page if something isn't working. Runnable examples are in samples/.

Credits

This project is grandly inspired by liamcottle/rustplus.js.

Special thanks to Versette and Devedse for their work on the RustPlusApi.Fcm socket.

About

A C# API for Rust+. It allows you to interact with a Rust (the facepunch game) server using Rust+ API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors