@kkdev92/vscode-ext-kit - v4.1.1
    Preparing search index...

    Variable SecretsConst

    Secrets: ServiceToken<SecretStore> = ...

    Injects the application's SecretStore, for secrets the user names.

    Distinct from defineSecret, which declares one key the extension knows about at definition time. A store covers the other case: an extension that lets a user keep several named credentials cannot declare their names, because it does not learn them until the user types one. Declaring a key and storing a user's are different abilities, not two ways to do the same thing.

    module.commands.handle(AddKey, {
    inject: { secrets: Secrets, ask: QuickInput },
    execute: async (_context, _args, { secrets, ask }) => {
    const name = await ask.text({ prompt: 'Key name' });
    if (name === undefined) return;
    await secrets.set(name, generated);
    },
    });