Skip to main content
Version: Next

StorageApi.snapshot()

Home > @backstage/core-plugin-api > StorageApi > snapshot

Returns an immediate snapshot value for the given key, if possible.

Signature:

snapshot<T extends JsonValue>(key: string): StorageValueSnapshot<T>;

Parameters

Parameter

Type

Description

key

string

**Returns:**

StorageValueSnapshot<T>

Remarks

Combine with StorageApi.observe$() to get notified of value changes.

Note that this method is synchronous, and some underlying storages may be unable to retrieve a value using this method - the result may or may not consistently have a presence of 'unknown'. Use StorageApi.observe$() to be sure to receive an actual value eventually.