Skip to main content

Licensing

The @spartaficial packages are commercial software: generating code requires a valid licence key, while building, testing and shipping the code you generated never does. This page tells you how to set the key up, what it covers, what still works without one, and what each licence error means.

Getting set up​

Set one environment variable:

SPARTAFICIAL_LICENSE_KEY=<your key>

That is the only configuration. There is no config-file field and no CLI flag, deliberately, so a key cannot be committed to a repository by accident or overridden per invocation.

In CI, add it as a secret:

# GitHub Actions
- run: npx openapi-to-zod
env:
SPARTAFICIAL_LICENSE_KEY: ${{ secrets.SPARTAFICIAL_LICENSE_KEY }}
# Azure Pipelines
- script: npx openapi-to-zod
env:
SPARTAFICIAL_LICENSE_KEY: $(SPARTAFICIAL_LICENSE_KEY)

What the key is bound to​

Each key names your organisation and an expiry date. One key covers every @spartaficial package in every project you own: set the same value wherever you run the generators, and you are done. You do not need a separate key per tool or per repository.

A key can optionally be restricted to a single project. Only then does it also carry that project's package.json name, and only then does it matter where you run the generator from: the project is resolved from the location of your codegen config file, not from the current working directory, so running the CLI from a monorepo root binds to the workspace the config lives in rather than the repo root.

Direct mode is the exception for restricted keys. openapi-to-k6 --input … --output … --output-types … has no config file to resolve from, so the project comes from the current directory: run it from the directory whose package.json your key names, or a perfectly valid restricted key reports PACKAGE_NAME_MISMATCH. When that happens the error says which directory was read, so the cause is visible rather than mysterious. There is deliberately no flag to override it. A key that is not restricted never reads package.json at all.

Using the generators from code​

The programmatic API, new OpenApiGenerator(spec).generate() and its siblings, checks the licence the first time it extracts operations from a spec, reading SPARTAFICIAL_LICENSE_KEY from the environment at that moment. A restricted key is then compared against the package.json nearest to the current working directory, because there is no config file to resolve it from. Failures surface as a thrown LicenseVerificationError whose message is the same text the CLI prints and whose code is one of the codes below.

What still works without a key​

A licence is required to generate. It is never required to build.

ActionNeeds a key
openapi-to-zod, openapi-to-typescript, … (generation)Yes
--help, --versionNo
init (scaffold a config)No
Compiling code that was already generatedNo
import ... from "@spartaficial/openapi-to-k6/runtime"No
playwright test against a generated clientNo

This is a hard guarantee, not an incidental one. If your licence lapses, your application keeps building and shipping from the code already in your repository; only re-running codegen fails. Generated files contain no licence logic of any kind.

Errors​

Every failure exits non-zero, writes nothing, and names a code.

CodeMeaningFix
LICENSE_KEY_MISSINGSPARTAFICIAL_LICENSE_KEY is unset or emptySet the variable
INVALID_SIGNATUREThe key was altered or truncatedRe-copy it in full
EXPIREDPast the valid-to dateRenew
NOT_YET_VALIDBefore the valid-from dateCheck the system clock
PACKAGE_NAME_MISMATCHThe key is restricted to a different project; both are namedRun it in that project, or request a wider key
PACKAGE_JSON_INVALIDThe key is restricted, and no package.json with a name existsRun from inside your project
ISSUER_MISMATCHNot issued by SpartaficialRe-request the key
INVALID_FORMATNot a license key at allRe-copy it
INVALID_HEADERHeader is corrupt or uses another algorithmRe-copy it
INVALID_PAYLOADPayload is corrupt, or carries a retired claimRequest a fresh key
UNKNOWN_KEY_IDSigned with a key this build does not knowUpgrade the package, or re-request
LICENSE_CONFIG_INVALIDA restricted key met a verifier with no project to compareReport it; this is an integration fault

One failure carries no code, because it is not about your licence at all:

ErrorMeaningFix
MissingSigningKeyErrorThe package was published without a signing key embeddedReport it; nothing you can do locally will help

That is a packaging fault on our side. Your licence is fine, and no version of it will work against such a build.

A run also warns for the 28 days before expiry, once per run.

Buying or renewing a key​

To buy or renew a key, contact Cerios - Spartaficial. A key is issued for your organisation with a validity of up to twenty-four months; twelve months is the usual term.