BellaBaxter.Maui 0.2.0

dotnet add package BellaBaxter.Maui --version 0.2.0
                    
NuGet\Install-Package BellaBaxter.Maui -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BellaBaxter.Maui" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BellaBaxter.Maui" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="BellaBaxter.Maui" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BellaBaxter.Maui --version 0.2.0
                    
#r "nuget: BellaBaxter.Maui, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BellaBaxter.Maui@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BellaBaxter.Maui&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=BellaBaxter.Maui&version=0.2.0
                    
Install as a Cake Tool

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

  1. First launch (online): Secrets are fetched from Bella Baxter and written to SecureStorage under a namespace prefix (bella.default.*).

  2. 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.

  3. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.2.0 0 11/26/2026
0.1.2 86 11/18/2026
0.1.1-preview.150 62 11/17/2026
0.1.1-preview.149 57 11/17/2026
0.1.1-preview.148 57 11/16/2026
0.1.1-preview.147 62 11/15/2026
0.1.1-preview.146 54 11/13/2026
0.1.1-preview.145 57 11/11/2026
0.1.1-preview.144 66 11/6/2026
0.1.1-preview.142 78 10/28/2026
0.1.1-preview.141 71 10/26/2026
0.1.1-preview.140 72 10/24/2026
0.1.1-preview.138 71 10/20/2026
0.1.1-preview.137 72 10/19/2026
0.1.1-preview.136 85 10/18/2026
0.1.1-preview.135 92 10/16/2026
0.1.1-preview.134 74 10/15/2026
0.1.1-preview.133 80 10/13/2026
0.1.1-preview.132 68 10/12/2026
0.1.1-preview.131 75 10/10/2026
Loading failed