Skip to main content

The key

Every expansion carries an apiKey in meta.json: a secret created on NMCrate and bound to one expansion id. The app verifies it each time the expansion loads, including after every hot reload.
An expansion whose key does not check out does not run at all.

Verified and untrusted

Untrusted is the normal state while you are building something: nobody has reviewed it, and the Expansions page says so. It behaves exactly like a verified expansion otherwise.

Offline

Verification is a network call, so an expansion does not load while the app is offline. This applies to legacy main.js expansions too.

Packing a .lde

.lde (Lode Expansion) is the packaged form NMCrate distributes: your folder, compressed and encrypted. .nxe is the same format under its previous name. The app still installs and reads those, so nothing already published needs repacking. Build one with compass, in the app’s console. Open it with the CLI button in the footer:
compass setup takes the id of the expansion to build, and builds only that one. Packing used to sweep up every folder in Expansions/, which shipped whatever else happened to be lying there. An SDK expansion is packed only if:
  • meta.json and config.json are valid, and
  • every module builds, with every import resolving.
So a .lde that exists is one that at least loads. The problems that stopped a build are printed in the console. node_modules is left out, since it is only your editor’s types. The package is named after the folder, not the id. Legacy main.js expansions build the same way, by the id in their metadata.

Open source packages

--open-source writes the zip without encrypting it. The extension and everything else stay the same, and the app loads it like any other package: it recognises a plain zip by its first bytes. Use it when the source is the point, for a community expansion or an example. Don’t use it if your meta.json carries a key you’d rather people didn’t read. Packing does not minify or obfuscate anything either way, so encryption is a speed bump rather than protection.

Before you publish

  • id matches the NMCrate expansion the key belongs to, and is not going to change afterwards.
  • version is bumped; that is what an update compares.
  • permissions lists only what you actually use. Each one is a line the user reads.
  • sdkVersion is the range you tested against.
  • The expansion loads from a clean copy of the folder, with no leftovers from your editor.

What an expansion may not do

Expansions add to Lode Studio. They may not stand in for the parts of it people pay for. An expansion must not:
  • unlock a paid feature, by patching, skipping or faking a licence, tier or account check (including what sdk.app.user() reports);
  • rebuild a paid feature so people can use it without buying it: Premium edition features, team features such as live collaboration, or Echo plans;
  • tamper with Lode Studio itself, its key verification, or its servers.
NMCrate does not publish expansions like these. If one is shared anyway, its key is disabled, and the author’s developer status and Lode Studio account can be terminated under the Developer Terms (sections 3.2 and 10.2).
Not sure whether your idea overlaps a paid feature? Ask support before you build it.

A note on secrets

Your key is readable by anyone who has your expansion: in a folder it is plain text, and a package is decrypted by the app to read it. Packing encrypts, but it does not minify or obfuscate your code, and the key that opens a package ships inside the app. Treat the key as an identifier, not a password, and never put any other secret in meta.json or in your source.