@dynamic-labs/sdk-react-core
Version:
A React SDK for implementing wallet web3 authentication and authorization to your website.
23 lines (22 loc) • 1.23 kB
TypeScript
import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
import { SocialAuthMode } from '../../hooks/useSocialAuth';
export declare const SOCIAL_STORAGE_KEY = "dynamic_social_storage";
export type SocialStorageItem = {
provider: ProviderEnum;
/** State issued to IDP on social authentication */
state: string;
/** Code verifier used to generate the code challenge for PKCE */
codeVerifier: string | undefined;
/** Captcha token used to verify the user is not a bot */
captchaToken?: string;
/** Oauth code from redirect from oauth provider, this will be provided on response from redirect endpoint **/
code?: string;
/** Social auth mode, either sign-in or link */
mode: SocialAuthMode;
/** Whether to show the widget after a connection is made */
showWidgetAfterConnection?: boolean;
};
export type SocialStorage = Partial<Record<ProviderEnum, SocialStorageItem>>;
export declare const searchSocialStorageByState: (targetState: string) => SocialStorageItem | undefined;
export declare const setSocialStorageFor: (provider: ProviderEnum, socialStorageItem: Omit<SocialStorageItem, 'provider'>) => void;
export declare const deleteSocialStorage: (provider: ProviderEnum) => void;