A comprehensive .NET client library for integrating Blazor WebAssembly applications with the RampEdge backend API. Provides robust authentication, automatic token management, and HTTP handlers for secure and efficient API communication.
Install the package:
dotnet add package Maker.RampEdgeConfigure in your Blazor WebAssembly app:
builder.Services.AddRampEdgeClient(builder.Configuration);- 🔐 Authentication Management: Complete lifecycle with automatic token refresh
- 💾 Token Storage: Secure browser localStorage integration
- 🌐 HTTP Pipeline: Bearer token attachment and business unit headers
- ⚙️ Easy Configuration: Both JSON and programmatic setup options
- 🔧 Dependency Injection: Seamless .NET DI integration
- 🧪 Fully Tested: Comprehensive unit tests with 17+ passing tests
Maker.RampEdge/
├── 📁 Configuration/          # Settings and options
├── 📁 Extensions/             # DI registration helpers
├── 📁 Http/                   # HTTP message handlers
├── 📁 Services/               # Core services and contracts
└── 📁 Tests/                  # Comprehensive test suite
{
  "RampEdge": {
    "BaseAddress": "https://api.rampedge.com",
    "BusinessUnitKey": "your-business-unit-key",
    "TokenRefreshThresholdMinutes": 5,
    "EnableAutoTokenRefresh": true
  }
}// Basic setup
builder.Services.AddRampEdgeClient(builder.Configuration);
// With custom configuration
builder.Services.AddRampEdgeClient(settings =>
{
    settings.BaseAddress = "https://api.rampedge.com";
    settings.BusinessUnitKey = "your-key";
});
// Advanced setup with callbacks
builder.Services.AddRampEdgeClient(
    builder.Configuration,
    onUnauthorized: async (request) => await HandleLogout());The package automatically configures two HTTP clients:
- RampEdgeAuth: Public endpoints (login, registration)
- RampEdgeApi: Authenticated endpoints with automatic token management
@inject IHttpClientFactory HttpClientFactory
// For authenticated calls
var apiClient = HttpClientFactory.CreateClient("RampEdgeApi");
var products = await apiClient.GetFromJsonAsync<Product[]>("/api/products");
// For public calls
var authClient = HttpClientFactory.CreateClient("RampEdgeAuth");
var info = await authClient.GetFromJsonAsync<PublicInfo>("/api/public/info");- StaticAppHeadersHandler → Adds BusinessUnitKey header
- BearerTokenHandler → Manages authentication tokens
- Checks token expiry before requests
- Automatically refreshes expired tokens
- Handles 401 responses with callbacks
 
- Automatic refresh when tokens near expiry (configurable threshold)
- Browser localStorage persistence
- Secure handling with JavaScript interop
- Event-driven authentication state changes
| Maker.Client | Maker.RampEdge | 
|---|---|
| Maker.Client.* | Maker.RampEdge.* | 
| MakerAIconfig section | RampEdgeconfig section | 
| AddMakerClient() | AddRampEdgeClient() | 
| IsMakerAIUser | IsRampEdgeUser | 
| "Api"/"Auth"clients | "RampEdgeApi"/"RampEdgeAuth" | 
The package includes comprehensive tests:
- Unit tests for all core components
- HTTP handler testing with mocks
- Service registration validation
- Browser interop simulation
Run tests:
dotnet testThis repository includes enterprise-grade automation:
- ✅ Continuous Integration: Automated builds and testing
- 🔒 Security Scanning: CodeQL, dependency analysis, vulnerability detection
- 📊 Quality Gates: SonarCloud analysis, code coverage, linting
- 📦 Automated Publishing: NuGet.org and GitHub Packages
- 🔄 Dependency Management: Dependabot updates
- 📋 Issue Templates: Structured bug reports and feature requests
- Package Documentation: Detailed usage guide
- Developer Guide: Development context and architecture
- CI/CD Guide: Complete automation documentation
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Submit a pull request
See our issue templates for bug reports and feature requests.
This project is licensed under the MIT License. See the LICENSE file for details.
- NuGet Package: Maker.RampEdge
- GitHub Repository: revred/RampEdge
- Issues: Report bugs or request features
Made with ❤️ for the .NET community