ConstOne of the player's shared keys, asked for when needed. When the package is allowed and the key is set, it answers at once. Otherwise REDnode's own Key request window asks the player to allow the package and, when no key is saved, to paste one; the package never sees that box. Resolves with the key, or null when the player denies, does not answer within 10 minutes, or the package stops. One window per package and service at a time.
Optionaloptions: AskSharedOptions// rednode-app.json: "permissions": ["keys:anthropic"]
import { secrets } from "rednode";
let key = await secrets.shared("anthropic");
if (!key) {
// A key this package kept itself before is offered to the shared store.
const mine = await secrets.get("anthropic-api-key");
key = await secrets.askShared("anthropic", { reason: "To answer your questions", offer: mine ?? undefined });
if (key && mine) await secrets.delete("anthropic-api-key");
}
Deletes the secret.
The secret, or null when it is not set.
Sets the secret.
One of the player's shared keys, such as "anthropic": the key, or null until the player
allows this package to use it, or while none is set. Never asks: use
secrets.askShared for that. The manifest must list "keys:<service>".
Secrets of this package, such as an API key. They are encrypted with the player's Windows account and kept by the REDnode host; a package can read only its own. They never go into the package's folder.
The player's AI service keys (Anthropic, Google Gemini, OpenAI, ElevenLabs and any other), typed once and shared by every EDGE tool on the PC, are read with secrets.shared and asked for with secrets.askShared: list
"keys:<service>"in the manifest'spermissions(from REDnode 0.48.0).