Skip to main content

TokenStorage

Datalayer Core


Datalayer Core / TokenStorage

Interface: TokenStorage

Defined in: src/client/auth/types.ts:72

Token storage backend interface

Methods

clear()?

optional clear(): void | Promise<void>

Defined in: src/client/auth/types.ts:112

Clear all authentication data (optional) May be async to support keyring storage

Returns

void | Promise<void>


delete()

delete(key): void

Defined in: src/client/auth/types.ts:84

Delete token from storage

Parameters

key

string

Returns

void


deleteToken()?

optional deleteToken(): void | Promise<void>

Defined in: src/client/auth/types.ts:102

Delete authentication token (convenience method) May be async to support keyring storage

Returns

void | Promise<void>


get()

get(key): string | null

Defined in: src/client/auth/types.ts:76

Get token from storage

Parameters

key

string

Returns

string | null


getToken()?

optional getToken(): string | null

Defined in: src/client/auth/types.ts:92

Get stored authentication token (convenience method)

Returns

string | null


isAvailable()

isAvailable(): boolean

Defined in: src/client/auth/types.ts:88

Check if storage is available

Returns

boolean


set()

set(key, value): void

Defined in: src/client/auth/types.ts:80

Set token in storage

Parameters

key

string

value

string

Returns

void


setToken()?

optional setToken(token): void | Promise<void>

Defined in: src/client/auth/types.ts:97

Store authentication token (convenience method) May be async to support keyring storage

Parameters

token

string

Returns

void | Promise<void>


setUser()?

optional setUser(user): void | Promise<void>

Defined in: src/client/auth/types.ts:107

Store user data (optional) May be async to support keyring storage

Parameters

user

any

Returns

void | Promise<void>