Retrieves a token value from memory storage
Gets a specific token value from memory storage with type safety. The generic parameter T allows for proper typing of the returned value.
Token key to retrieve
The stored value or null if not found
// Get access token with proper typingconst accessToken = retrieveTokenValue<string>(ACCESS_TOKEN_KEY);if (accessToken) { // Use the access token} Copy
// Get access token with proper typingconst accessToken = retrieveTokenValue<string>(ACCESS_TOKEN_KEY);if (accessToken) { // Use the access token}
Use getAccessToken, getRefreshToken, etc. from token-operations instead
export function retrieveTokenValue<T extends TokenValue>( key: string,): T | null { return (memoryTokenStorage[key] as T) || null;} Copy
export function retrieveTokenValue<T extends TokenValue>( key: string,): T | null { return (memoryTokenStorage[key] as T) || null;}
Retrieves a token value from memory storage
Gets a specific token value from memory storage with type safety. The generic parameter T allows for proper typing of the returned value.