Publishing a plugin
The plugin API is experimental, except for the
v1 data source contract: for capabilities outside that
contract, say so in your README and pin the version of recit your plugin peers on
(Stability).
Name and keyword
- The package is
recit-orplugin- <name> @scope/.recit- plugin- <name> package.jsoncarries therecit-pluginkeyword, and peers onrecitandzod.- Its README says what it brings, and, for an AI plugin, where your content goes.
Without showing the source
- Publish
dist/alone. Thefilesfield ofpackage.jsonlists the built code, the README and the license. Nosrc/, no tests, no fixtures. - Minify, without sourcemaps. A sourcemap often holds the whole source (
sourcesContent). Turn them off for the release. - Obfuscation is possible, but it is not a protection. It slows reading down, it does not stop it. Récit does not provide it.
- A private registry or tarballs. A private package on npm, GitHub Packages, a registry of your
own, or a
.tgzarchive sent to the customer. - A proprietary license.
"license":(or"SEE LICENSE IN LICENSE.md" UNLICENSED), and your text inLICENSE.md. - For a real secret, a thin client. Everything that runs on the user's machine can be read, and
every component sent to the browser is public. Keep the prompts, the logic and the data on your
server: the plugin is only a client of your API (
serverProviderandcreateAiServerof@recit/ai), with a license key.
Selling a plugin
Récit records who holds a licence for your plugin; you keep serving the plugin itself. The plugin's archive stays in your private registry or with your tarballs, and your server asks Récit's API whether the customer's account holds the licence before it serves anything.
-
The customer creates a personal token on their account page, with the
licenses:scope, and gives it to your registry (anread .npmrcentry, or the header of their download). -
Your server asks for the licence with that token, for your product and your plugin:
CodeGET /asks for a licence of the whole product instead.v1/ licenses/ <productId> -
200serves the archive. The answer is{ license:, never cached ({ productId, resourceId, plan, organizationId, endsAt } } Cache-);Control: no- store endsAtisnullfor a licence without an end. -
404refuses it. The account holds no such licence, or the product does not exist: the answer never says which.401means the token is missing, revoked, expired or lackslicenses:.read
Rules that hold whatever you sell:
- A build never depends on this check. Ask at download time, never from the plugin's code at build or render time: an installed plugin keeps working offline and when Récit's API is out of reach.
- The plugin never imports a package of the platform. It talks to the API over HTTP only
(
pnpm checkrefuses a plugin that depends on one). - The token is the customer's. Never store it beyond the request, never log it.
The route belongs to the account API (licences, available).