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

01
Pick a module
Choose from the nine BaaS modules below — Identity, Wallet, NotificationHub, Insights, FileServer, Forms, InstantMessaging, EventHub, Identity.Server.
02
Provision
One CloudFormation deploy per module, per AWS account. `kanject baas deploy <module>` runs it. Templates are idempotent — re-deploys are safe.
03
Wire it up
Add the matching `Kanject.<Module>` package, register via `AddKanject<Module>()` in `Program.cs`.
04
Use the API
Inject the module's client interface anywhere in your service — same DI patterns as Kanject.Core.

Provision the modules you need

Each module is a CloudFormation stack in your AWS account, named <stage>-<service>-<module>. The CLI wraps the deploy:

bash
# 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:

csharp
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

csharp
// 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

Kanject.Identity
Cognito user pool + JWT issuance + RBAC + MFA + social login. /baas/identity
Kanject.Identity.Server
Self-hosted OAuth 2.0 / OIDC provider — be your own IdP. /baas/identity-server
Kanject.Wallet
Double-entry ledger, multi-currency, holds, payouts, KYC hooks. /baas/wallet
Kanject.NotificationHub
Email, SMS, push, in-app — one template, four channels, smart cancellations. /baas/notifications
Kanject.Insights
Event-driven analytics — funnels, cohorts, correlations — no SQL. /baas/insights
Kanject.FileServer
S3-backed storage with CDN, signed URLs, virus scanning, versioning. /baas/fileserver
Kanject.Forms
Schema-as-code form builder backend with conditional fields and exports. /baas/forms
Kanject.InstantMessaging
WebSocket chat with presence, typing indicators, group + channel support. /baas/im
Kanject.EventHub
Typed pub/sub on EventBridge with replay, DLQs, and local emulator. /baas/eventhub

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.

Pro tip
Use the same 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.