Deploying Kanject BaaS
Kanject BaaS modules deploy into your AWS account, not ours. Each module ships as a NuGet package plus a CloudFormation template; you provision them once per environment and your service code talks to them like any internal dependency.
Because the modules run in your account, there are no per-request, per-user, or per-message Kanject charges. AWS bills you the same as if you'd written the integration yourself — Kanject only charges for the libraries.
Workflow
Provision the modules you need
Each module is a CloudFormation stack in your AWS account, named <stage>-<service>-<module>. The CLI wraps the deploy:
# One-time, per AWS account, per stage. Idempotent — safe to re-run.
kanject baas deploy identity --env dev
kanject baas deploy notifications --env dev
kanject baas deploy wallet --env dev Register them in your service
Every module exposes an AddKanject<Module>(IConfiguration) extension that reads its own config block from your layered appsettings + Parameter Store. Composition is order-independent:
using Kanject.Identity.Extensions;
using Kanject.NotificationHub.Extensions;
using Kanject.Wallet.Extensions;
var builder = WebApplication.CreateBuilder(args);
// Each module reads its own config block from appsettings + Parameter Store
builder.Services.AddKanjectIdentity(builder.Configuration);
builder.Services.AddKanjectNotificationHub(builder.Configuration);
builder.Services.AddKanjectWallet(builder.Configuration);
var app = builder.Build();
app.Run(); Use them anywhere
// Now inject the client interface anywhere in your service —
// same DI patterns as Kanject.Core.
public class CheckoutService(
IIdentityClient identity,
IWalletClient wallet,
INotificationHub notifications)
{
public async Task<Receipt> CheckoutAsync(CheckoutRequest req)
{
var user = await identity.Users.GetAsync(req.UserId);
await wallet.TransferAsync(new Transfer { /* ... */ });
await notifications.SendAsync(new {
Template = "order_shipped",
UserId = user.Id,
Channels = Channel.Email | Channel.Push,
});
return new Receipt(/* ... */);
}
} The nine modules
Multi-region deployments
Each BaaS module supports multi-region deployment via the --region flag on kanject baas deploy. Kanject.Core.NoSqlDatabase's Namespace option keeps tenant data isolated across regions; Kanject.EventHub replicates events via SNS cross-region subscriptions.
Bring-your-own-providers
NotificationHub ships with AWS-native defaults (SES, SNS, APNs, FCM) but every channel is pluggable — register SendGridProvider, TwilioProvider, your own IEmailProvider. The engine still owns scheduling, retries, opt-ins and telemetry; the wire stays in your hands.
appsettings.<Env>.json layered config across Core and BaaS modules — they read from the same IConfiguration surface, so a single deploy command can target staging or production.