Skip to content

Developer guide preview ​

One catalog of your product. Every customer, every environment, every odd little difference, written down once. Your code asks for its configuration and gets the merge. That's it. That's the trick.

This guide is the friendly, short version of the 2S Platform for people who write code. Each page takes one package, tells you why you'd want it, and gets you to working code in a couple of minutes. The deep, every-edge-case reference lives on GitHub, and every page links to it at the end.

In a hurry?

Jump to the quick start: from zero to IOptionsMonitor<T> in five steps.

2S in one minute ​

You know this folder:

text
appsettings.json
appsettings.Production.json
appsettings.Production.Northwind.json
appsettings.Production.Northwind.FINAL.json
appsettings.Production.Northwind.FINAL-v2-really.json

Every customer and every environment gets a copy, the copies drift apart, and nobody remembers why Northwind has retries: 7.

The 2S Platform's Storyteller keeps a catalog of your product instead: your customers, your modules, and where each module runs for each customer. Every record in that catalog can hold a small configuration document with only its own difference. When a service asks for its configuration, Storyteller merges everything from the general to the specific, and hands back one document.

Write the product default once, the customer's change once, the environment's change once. Done. No copies, and the reason for retries: 7 has a name, an author and a history.

Seven words to learn ​

That's the whole vocabulary. Three are nouns you pick, the rest are the relations between them.

WordCodeThink of it asExample
SubjectsbtWho it is for: a customer, a market, a product modelnorthwind
ResponsibilityrstWhat you ship: a module, a service, a capabilityinvoicing
ContextcntOne of the subject's worlds: an environment, a regionproduction
Usageusg"This subject uses this responsibility", with its plan and seatsnorthwind uses invoicing
ExecutionexeThat usage, running in one context: the thing your service isinvoicing for northwind in production
UnituntA job or event inside a responsibilitynightly-export
Unit of executionuxeThat job, inside one executionnightly-export of Northwind's production

The annotations page tells the longer story, with pictures.

Read a key like a sentence ​

Every record has a key, and the key reads left to right, from who owns it to what it is:

text
@house.main.default.exe.northwind.invoicing.production
 │     │    │       │   │         │         └─ context
 │     │    │       │   │         └─ responsibility
 │     │    │       │   └─ subject
 │     │    │       └─ type code: an execution
 │     │    └─ view: an edition of the catalog (default is production)
 │     └─ project
 └─ organization

The part after the view, exe.northwind.invoicing.production, is the annotation key. With the @organization.project.view. in front, it is the full key: the one value a service needs to know who it is.

Which package do I need? ​

Writing .NET?

Something else?

The package map ​

Everything we serve, at a glance. You usually install one of the first four and the rest arrives with it.

PackageFromIn one lineRead
42.Platform.Storyteller.
Configuration
NuGetYour configuration in IConfiguration, kept fresh, survives outagesConfiguration provider
42.Platform.Storyteller.
Configuration.KeyVault
NuGetSecrets resolved by your app, with your app's own identityKey Vault secrets
42.Platform.Storyteller.
Hosting
NuGet"Who am I?", the catalog, and a worker for every customerHosting
42.Platform.Storyteller.
Aspire.Hosting
NuGetAn Aspire AppHost hands the right variables to every projectAspire
42.Platform.Storyteller.
ConfigurationFormats
NuGet, comes with the providerOne document as flat JSON, .properties, .env or YAMLConfiguration formats
42.Platform.Storyteller.
Sdk.NSwag
NuGet, comes with the providerThe whole API as typed C# clients, with machine sign-inC# SDK
42.Platform.Storyteller.
Abstractions.Annotations
NuGet, comes alongKeys and models: AnnotationKey, FullKey, AnnotationTypeC# SDK
42.Platform.Storyteller.
KeyValues.ClientEncryption
NuGet, comes alongEncrypt a secret on your side, so not even the platform can read itC# SDK
@42for.net/2splatform.sdknpmThe whole API for TypeScript, with Vue Query, Zod and MSW mocksTypeScript SDK
42.Platform.Cli (sform)NuGet, a dotnet toolThe platform's command line, for you and for your pipelinessform & CI
The GitHub Actionuses: in a workflowA resolved configuration in the environment of a GitHub Actions jobsform & CI
The MCP serveran address of your deploymentYour AI assistant browses the catalog as you, and edits it where the deployment allowsAI assistants

Hosting the platform yourself? The 2sInitDb tool (42.Platform.Storyteller.DbCreator) creates and seeds the database. Everybody else can forget it exists.

Getting the bits ​

Every package is on nuget.org (and the TypeScript SDK on npm). We ship fast, so new versions arrive as prereleases first: add --prerelease to get the newest. Our prereleases are tested and safe to use.

Every .NET package targets .NET 10. The packages are released together, so keep their versions together too: let Hosting bring Configuration, rather than updating one of them on its own.

Where next ​

  • New here? The quick start walks through everything once.
  • Just want configuration? The configuration provider is two lines of code.
  • Lost? The cheat sheet has every variable, every type code and the answers to "why does it say 403".

Released under the MIT License.