Skip to content

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.

CICDDocs

.NETNuGet VersionLicense: MITcodecovMutation Score

Getting Started · Documentation · Samples

Packages

PackageDownloadsDescription
RustPlusApiDownloadsCore 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.FcmDownloadsFCM listener — receives server/entity pairing and alarm notifications.
RustPlusApi.Fcm.RegistrationDownloadsNative credential acquisition (GCM/Firebase/FCM/Expo + Steam login + Rust Companion). Replaces the rustplus.js Node CLI.
RustPlusApi.CameraDownloadsCamera sessions (CameraController: keep-alive, turret/PTZ helpers, device-kind checks) and frame rendering via ImageSharp.
RustPlusApi.Extensions.DependencyInjectionDownloadsDI registration (AddRustPlus, IRustPlusFactory) for the core client.
RustPlusApi.Fcm.Extensions.DependencyInjectionDownloadsDI 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:

usingvarrustPlus=newRustPlus(newRustPlusConnection(server,port,playerId,playerToken));awaitrustPlus.ConnectAsync();varinfo=awaitrustPlus.GetInfoAsync();Console.WriteLine(info.Data?.Name);

3. Listen for notifications:

varlistener=newRustPlusFcm(credentials);listener.OnServerPairing+=(_,e)=>Console.WriteLine($"Paired: {e.Data?.Ip}");awaitlistener.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# library for the Rust+ companion API. Query and control your server, render security cameras, listen for push notifications, and acquire all the required credentials natively.

Topics

Resources

Security policy

Stars

18 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages