Viu.Emporix.MixinSync
0.12.4
dotnet tool install --global Viu.Emporix.MixinSync --version 0.12.4
dotnet new tool-manifest
dotnet tool install --local Viu.Emporix.MixinSync --version 0.12.4
#tool dotnet:?package=Viu.Emporix.MixinSync&version=0.12.4
nuke :add-package Viu.Emporix.MixinSync --version 0.12.4
Viu.Emporix.MixinSync
Generates typed C# for an Emporix tenant's mixins and detects schema drift.
A companion to Viu.Emporix, the
unofficial .NET SDK for the Emporix Commerce Engine. Built and maintained by
viu. Not an official product of Emporix AG.
What it is for
A mixin is a set of tenant-defined fields stored under entity.mixins.<key>,
described by a JSON Schema that Emporix hosts and versions. Those fields are
specific to your tenant, so their types cannot ship inside an SDK — this tool
generates them into your own repository.
dotnet tool install --global Viu.Emporix.MixinSync
Commands
emporix-mixins pull # read the Schema Service, write the snapshot and lockfile
emporix-mixins generate # turn the snapshot into C# types, contexts and a registry
emporix-mixins check # compare the tenant against the lockfile; exits 1 on drift
generate reads the committed snapshot, never the network, so your build stays
offline and deterministic. Commit everything it writes.
Configuration
emporix-mixins.json, beside your solution:
{
"tenant": "acme",
"namespace": "Acme.Mixins",
"out": "src/Acme.Shop/Mixins/Generated",
"lockFile": "src/Acme.Shop/Mixins/mixins.lock.json"
}
Credentials come from EMPORIX_BACKEND_CLIENT_ID and EMPORIX_BACKEND_SECRET —
the Schema Service is seller-side — so the file holds nothing secret and belongs
in version control.
Pass a different path as the second argument: emporix-mixins pull path/to/config.json.
What you get
One namespace and one JsonSerializerContext per mixin, plus a registry binding
them to the SDK:
var delivery = MixinReader.Read(product.Mixins, Mixins.DeliveryOptions);
var w = MixinWriter.Create().Set(Mixins.DeliveryOptions, value);
product.Mixins = w.Values;
product.Metadata.Mixins = w.SchemaUrls; // Emporix leaves a mixin unvalidated without this
var paper = Condition.EqualTo("Paper");
string q = MixinQuery.For(Mixins.DeliveryOptions)
.Where(d => d.Packaging, paper)
.Build()
.Build();
The generated code is Native AOT compatible and reflection-free, matching the SDK's own guarantees.
Drift detection
Emporix assigns a new schema version on every change, and nothing tells you when
it happens. That is what check is for — put it in your own repository:
on:
schedule: [{ cron: "0 6 * * *" }]
workflow_dispatch: {}
jobs:
drift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v5
- run: dotnet tool install --global Viu.Emporix.MixinSync
- run: emporix-mixins pull && emporix-mixins generate
env:
EMPORIX_BACKEND_CLIENT_ID: ${{ secrets.EMPORIX_BACKEND_CLIENT_ID }}
EMPORIX_BACKEND_SECRET: ${{ secrets.EMPORIX_BACKEND_SECRET }}
- uses: peter-evans/create-pull-request@v8
with:
title: "chore: sync mixin schema versions"
branch: mixins/sync
A raised version then arrives as a pull request with the type diff beside it. Generating classes by hand takes ten minutes; noticing that a schema moved does not happen by hand at all.
Documentation
- SDK readme — the runtime side
- Design spec — including the
qforms not yet verified against a live tenant - Issues
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.12.4 | 61 | 10/22/2026 |
| 0.12.3 | 73 | 10/20/2026 |
| 0.12.2 | 85 | 10/19/2026 |
| 0.12.1 | 89 | 10/14/2026 |
| 0.12.0 | 78 | 10/14/2026 |
| 0.11.2 | 83 | 10/14/2026 |
| 0.11.1 | 90 | 10/9/2026 |
| 0.11.0 | 89 | 10/9/2026 |
| 0.10.0 | 103 | 10/8/2026 |
| 0.9.2 | 95 | 10/7/2026 |
| 0.9.1 | 104 | 10/2/2026 |
| 0.9.0 | 109 | 10/1/2026 |
| 0.8.0 | 93 | 10/1/2026 |
| 0.7.0 | 99 | 9/28/2026 |
| 0.6.0 | 109 | 9/11/2026 |
| 0.5.0 | 120 | 9/10/2026 |
| 0.4.2 | 119 | 9/9/2026 |
| 0.4.1 | 116 | 9/7/2026 |
| 0.4.0 | 135 | 9/4/2026 |
| 0.3.3 | 111 | 9/3/2026 |