Skip to main content

Interface: SecretStorage

Represents a storage utility for secrets, information that is sensitive.

Properties

onDidChange

onDidChange: Event<SecretStorageChangeEvent>

Fires when a secret is stored or deleted.

Source

packages/extension-api/src/extension-api.d.ts:4253

Methods

delete()

delete(key): Promise<void>

Remove a secret from storage.

Parameters

key: string

The key the secret was stored under.

Returns

Promise<void>

Source

packages/extension-api/src/extension-api.d.ts:4248


get()

get(key): Promise<undefined | string>

Retrieve a secret that was stored with key. Returns undefined if there is no secret matching that key.

Parameters

key: string

The key the secret was stored under.

Returns

Promise<undefined | string>

The stored value or undefined.

Source

packages/extension-api/src/extension-api.d.ts:4235


store()

store(key, value): Promise<void>

Store a secret under a given key.

Parameters

key: string

The key to store the secret under.

value: string

The secret.

Returns

Promise<void>

Source

packages/extension-api/src/extension-api.d.ts:4242