BellaBaxter.Maui 0.1.1-preview.126

This is a prerelease version of BellaBaxter.Maui.
dotnet add package BellaBaxter.Maui --version 0.1.1-preview.126
                    
NuGet\Install-Package BellaBaxter.Maui -Version 0.1.1-preview.126
                    
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.1.1-preview.126" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BellaBaxter.Maui" Version="0.1.1-preview.126" />
                    
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.1.1-preview.126
                    
#r "nuget: BellaBaxter.Maui, 0.1.1-preview.126"
                    
#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.1.1-preview.126
                    
#: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.1.1-preview.126&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=BellaBaxter.Maui&version=0.1.1-preview.126&prerelease
                    
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.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
Loading failed