Skip to main content

Class: ClientStorage

The ClientStorage class is a utility class for storing strings and objects.

When using MedplumClient in the browser, it will be backed by browser localStorage.

When Using MedplumClient in the server, it will be backed by the MemoryStorage class. For example, the Medplum CLI uses FileSystemStorage.

Constructors

constructor

new ClientStorage()

Defined in

packages/core/src/storage.ts:13

Methods

clear

clear(): void

Returns

void

Defined in

packages/core/src/storage.ts:17


getString

getString(key): undefined | string

Parameters

NameType
keystring

Returns

undefined | string

Defined in

packages/core/src/storage.ts:21


setString

setString(key, value): void

Parameters

NameType
keystring
valueundefined | string

Returns

void

Defined in

packages/core/src/storage.ts:25


getObject

getObject<T>(key): undefined | T

Type parameters

Name
T

Parameters

NameType
keystring

Returns

undefined | T

Defined in

packages/core/src/storage.ts:33


setObject

setObject<T>(key, value): void

Type parameters

Name
T

Parameters

NameType
keystring
valueT

Returns

void

Defined in

packages/core/src/storage.ts:38