Skip to content
Client
Server

Reference / @open-music-sdk/user-token / tKvNamespace

Interface: tKvNamespace ​

Defined in: user-token/src/stores.ts:55

The part of a Workers KV namespace the store uses. Anything with these three methods fits.

Methods ​

delete() ​

ts
delete(key): Promise<unknown>;

Defined in: user-token/src/stores.ts:77

Removes a key and its value, if there is one.

Parameters ​

key ​

string

The key, as the store made it.

Returns ​

Promise<unknown>

Whatever the namespace answers; the store reads nothing from it.


get() ​

ts
get(key): Promise<string | null>;

Defined in: user-token/src/stores.ts:62

The value under a key.

Parameters ​

key ​

string

The key, as the store made it: the prefix and the user id.

Returns ​

Promise<string | null>

The value, or null when there is none, as Workers KV answers.


put() ​

ts
put(key, value): Promise<unknown>;

Defined in: user-token/src/stores.ts:70

Writes a value under a key, in place of what is there.

Parameters ​

key ​

string

The key, as the store made it.

value ​

string

The token.

Returns ​

Promise<unknown>

Whatever the namespace answers; the store reads nothing from it.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.