BellaBaxter.Maui
0.1.1-preview.126
dotnet add package BellaBaxter.Maui --version 0.1.1-preview.126
NuGet\Install-Package BellaBaxter.Maui -Version 0.1.1-preview.126
<PackageReference Include="BellaBaxter.Maui" Version="0.1.1-preview.126" />
<PackageVersion Include="BellaBaxter.Maui" Version="0.1.1-preview.126" />
<PackageReference Include="BellaBaxter.Maui" />
paket add BellaBaxter.Maui --version 0.1.1-preview.126
#r "nuget: BellaBaxter.Maui, 0.1.1-preview.126"
#:package BellaBaxter.Maui@0.1.1-preview.126
#addin nuget:?package=BellaBaxter.Maui&version=0.1.1-preview.126&prerelease
#tool nuget:?package=BellaBaxter.Maui&version=0.1.1-preview.126&prerelease
BellaBaxter.Maui
Offline-capable secret cache for .NET MAUI apps. Caches secrets from Bella Baxter in the device's secure storage so your app can start and run without a network connection after the first successful sync.
| Platform | Storage |
|---|---|
| iOS / macOS | Apple Keychain |
| Android | EncryptedSharedPreferences (AES-256 GCM) |
| Windows | Windows Credential Store (DPAPI) |
Installation
dotnet add package BellaBaxter.Maui
dotnet add package BellaBaxter.AspNet.Configuration
Usage
Wire MauiSecureSecretCache into AddBellaSecrets() in MauiProgram.cs:
using BellaBaxter.AspNet.Configuration;
using BellaBaxter.Maui;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder.UseMauiApp<App>();
// Loads secrets from Bella Baxter + caches them in SecureStorage for offline use
builder.Configuration.AddBellaSecrets(o =>
{
o.BaxterUrl = "https://api.bella-baxter.io";
o.ApiKey = "bax-..."; // from environment or secure config
o.EnvironmentSlug = "production"; // or omit to auto-detect from API key
o.Cache = new MauiSecureSecretCache(); // ← enables offline startup
});
// Optionally register a source-generated typed-secrets class
builder.Services.AddBellaTypedSecrets<BellaAppSecrets>();
return builder.Build();
}
}
Accessing secrets
Option 1 — typed class (recommended, via source generator):
// Injected anywhere via DI
public class MyPage(BellaAppSecrets secrets) : ContentPage
{
void OnLoad() => label.Text = secrets.DatabaseUrl;
}
Option 2 — IConfiguration (standard .NET):
public class MyPage(IConfiguration config) : ContentPage
{
void OnLoad() => label.Text = config["DATABASE_URL"];
}
How offline mode works
First launch (online): Secrets are fetched from Bella Baxter and written to
SecureStorageunder a namespace prefix (bella.default.*).Subsequent launches (offline): If the Bella Baxter API is unreachable and
FallbackOnError = true(the default),MauiSecureSecretCache.ReadAsync()is called and secrets are served from secure storage.When connectivity returns: The polling timer fetches fresh secrets from the API and updates both the in-memory configuration and the secure storage cache.
Android: Auto Backup setup
Android's Auto Backup feature can copy EncryptedSharedPreferences to a new device,
but the encryption keys are not transferred — making the restored data unreadable.
MauiSecureSecretCache handles this gracefully by catching decryption errors and
clearing the stale cache so fresh secrets can be fetched on the next API call.
To prevent the issue entirely, exclude Bella's preference file from backups in
Platforms/Android/AndroidManifest.xml:
<application
android:fullBackupContent="@xml/auto_backup_rules"
...>
</application>
Create Platforms/Android/Resources/xml/auto_backup_rules.xml:
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="${applicationId}.microsoft.maui.essentials.preferences.xml"/>
</full-backup-content>
Multiple environments
Use a different storageKey per environment to avoid collisions:
o.Cache = new MauiSecureSecretCache("production"); // keys: bella.production.*
o.Cache = new MauiSecureSecretCache("staging"); // keys: bella.staging.*
License
MIT — see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-android36.0 is compatible. net10.0-ios26.0 is compatible. net10.0-maccatalyst26.0 is compatible. |
-
net10.0-android36.0
- BellaBaxter.AspNet.Configuration (>= 0.1.1-preview.126)
- Microsoft.Maui.Essentials (>= 10.0.51)
-
net10.0-ios26.0
- BellaBaxter.AspNet.Configuration (>= 0.1.1-preview.126)
- Microsoft.Maui.Essentials (>= 10.0.51)
-
net10.0-maccatalyst26.0
- BellaBaxter.AspNet.Configuration (>= 0.1.1-preview.126)
- Microsoft.Maui.Essentials (>= 10.0.51)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.1-preview.126 | 0 | 10/5/2026 |
| 0.1.1-preview.124 | 39 | 10/2/2026 |
| 0.1.1-preview.123 | 37 | 10/2/2026 |
| 0.1.1-preview.122 | 36 | 10/2/2026 |
| 0.1.1-preview.121 | 54 | 9/28/2026 |
| 0.1.1-preview.119 | 53 | 9/28/2026 |
| 0.1.1-preview.118 | 48 | 9/27/2026 |
| 0.1.1-preview.117 | 67 | 9/26/2026 |
| 0.1.1-preview.116 | 57 | 9/25/2026 |
| 0.1.1-preview.115 | 53 | 9/22/2026 |
| 0.1.1-preview.114 | 62 | 9/22/2026 |
| 0.1.1-preview.113 | 57 | 9/21/2026 |
| 0.1.1-preview.112 | 61 | 9/21/2026 |
| 0.1.1-preview.111 | 61 | 9/18/2026 |
| 0.1.1-preview.110 | 61 | 9/18/2026 |
| 0.1.1-preview.109 | 59 | 9/18/2026 |
| 0.1.1-preview.108 | 66 | 9/17/2026 |
| 0.1.1-preview.107 | 57 | 9/17/2026 |
| 0.1.1-preview.106 | 57 | 9/15/2026 |
| 0.1.1-preview.105 | 54 | 9/15/2026 |