FortniteDotNet is a simple and easy-to-use library used for interacting with Fortnite's HTTP and XMPP services. Features include interactions with parties and friends, general API data, and more.
You can find FortniteDotNet on any NuGet package manager. Alternatively, you can use the dotnet CLI.
dotnet add package FortniteDotNet
Below is a list of some of the features FortniteDotNet includes.
- Party and XMPP services
- Friends services, including legacy endpoints
- Fortnite services
- Cloudstorage (system/user)
- Storefront requests (shop)
- Profile-related operations (QueryProfile, etc.)
- Dependency injection
- Asynchronous codebase
FortniteDotNet uses dependency injection. There are two ways to access different services within FortniteDotNet. Please ensure the package Microsoft.Extensions.DependencyInjection
is installed.
First:
// Add the services upon creation
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder().UseMauiApp<...>();
builder.Services.AddFortniteApi();
...
return builder.Build();
}
then...
// Get a service through a constructor
private readonly IAccountService _accountService;
public ExampleClass(IAccountService accountService)
{
_accountService = accountService;
}
or...
// Inject a service into a component
@inject IAccountService _accountService;
First:
public void ConfigureServices(IServiceCollection services)
{
...
services.AddFortniteApi();
}
then...
// Get a service through a constructor
private readonly IAccountService _accountService;
public ExampleClass(IAccountService accountService)
{
_accountService = accountService;
}
var services = new ServiceCollection()
.AddFortniteDotNet()
.BuildServiceProvider();
...
// Get a service
var accountService = services.GetService<IAccountService>();
The rewrite is yet to be completed, so I have not provided an example yet. You can see tips on usage above.
I've commented the example code so you can have some sort of understanding of what it's doing. Please also note that this is just an example, and there's plenty more that you can do with FortniteDotNet.
// TODO
If you wish to contribute to FortniteDotNet, you can do so by cloning this repository, making your changes, and submitting a pull request. If I deem the pull request inappropriate, I will deny it.
FortniteDotNet is not entirely finished, especially due to the lack of MCP commands, so any contributions are greatly appreciated. The code structure is organised so should be easy to understand, however if you struggle, please don't hesitate to get in touch.
For any queries regarding FortniteDotNet, you can open an issue or a pull request, and I will happily reply to the thread.