@teamhanko/hanko-frontend-sdk
Version:
A package for simplifying UI integration with the Hanko API. It is meant for use in browsers only.
23 lines (22 loc) • 866 B
TypeScript
/**
* Generates a high-entropy, cryptographically strong random string for use as a PKCE code verifier.
* It uses rejection sampling to eliminate modulo bias, ensuring a perfectly uniform distribution
* across the character set recommended by RFC 7636.
*
* @returns {string} A 64-character URL-safe random string.
*/
export declare const generateCodeVerifier: () => string;
/**
* Stores the PKCE code verifier in sessionStorage.
* @param {string} verifier - The verifier to store.
*/
export declare const setStoredCodeVerifier: (verifier: string) => void;
/**
* Retrieves the PKCE code verifier from sessionStorage.
* @returns {string | null}
*/
export declare const getStoredCodeVerifier: () => string | null;
/**
* Removes the PKCE code verifier from sessionStorage.
*/
export declare const clearStoredCodeVerifier: () => void;