export { StytchHeadlessClient, createStytchClient, createStytchHeadlessClient } from './index.headless.js'; import { x as PermissionsMap } from './createAuthUrlHandler-CH6XQXol.js'; export { y as AuthFlowType, z as B2BEmailMagicLinksOptions, C as B2BEmailOTPOptions, D as B2BMFAProducts, E as B2BMemberDeleteMFAPhoneNumberResponse, F as B2BMemberDeleteMFATOTPResponse, G as B2BMemberDeletePasswordResponse, H as B2BMemberGetConnectedAppsResponse, J as B2BMemberOnChangeCallback, K as B2BMemberRevokeConnectedAppOptions, L as B2BMemberRevokeConnectedAppResponse, M as B2BMemberStartEmailUpdateRequest, N as B2BMemberStartEmailUpdateResponse, Q as B2BMemberUnlinkRetiredEmailRequest, R as B2BMemberUnlinkRetiredEmailResponse, T as B2BMemberUpdateOptions, U as B2BMemberUpdateResponse, B as B2BOAuthAuthorizeStartOptions, n as B2BOAuthAuthorizeStartResponse, o as B2BOAuthAuthorizeSubmitOptions, p as B2BOAuthAuthorizeSubmitResponse, q as B2BOAuthLogoutStartOptions, r as B2BOAuthLogoutStartResponse, V as B2BOAuthOptions, W as B2BOAuthProviderConfig, X as B2BOAuthProviders, Y as B2BPasswordOptions, Z as B2BSCIMCreateConnectionOptions, _ as B2BSCIMCreateConnectionResponse, $ as B2BSCIMDeleteConnectionResponse, a0 as B2BSCIMGetConnectionGroupsOptions, a1 as B2BSCIMGetConnectionGroupsResponse, a2 as B2BSCIMGetConnectionResponse, a3 as B2BSCIMRotateCancelResponse, a4 as B2BSCIMRotateCompleteResponse, a5 as B2BSCIMRotateStartResponse, a6 as B2BSCIMUpdateConnectionOptions, a7 as B2BSCIMUpdateConnectionResponse, a8 as B2BSMSOTPOptions, a9 as B2BSSOOptions, aa as B2BSessionAccessTokenExchangeOptions, ab as B2BSessionAccessTokenExchangeResponse, ac as B2BSessionAttestOptions, ad as B2BSessionAttestResponse, ae as B2BSessionAuthenticateResponse, af as B2BSessionExchangeOptions, ag as B2BSessionExchangeResponse, ah as B2BSessionOnChangeCallback, ai as B2BSessionRevokeForMemberOptions, aj as B2BSessionRevokeForMemberResponse, ak as B2BSessionRevokeOptions, al as BiometricsAuthenticateCompleteResponse, am as BiometricsAuthenticateOptions, an as BiometricsAuthenticateStartResponse, ao as BiometricsDeleteResponse, ap as BiometricsGetSensorResponse, aq as BiometricsRegisterCompleteResponse, ar as BiometricsRegisterOptions, as as BiometricsRegisterStartResponse, at as BiometryType, au as ConsumerPermissionsMap, av as DirectLoginForSingleMembershipConfig, m as IHeadlessB2BIDPClient, t as IHeadlessB2BMemberClient, v as IHeadlessB2BRBACClient, w as IHeadlessB2BSCIMClient, u as IHeadlessB2BSelfClient, s as IHeadlessB2BSessionClient, aw as IHeadlessBiometricsClient, I as IHeadlessIDPClient, k as IHeadlessImpersonationClient, g as IHeadlessOAuthClient, l as IHeadlessRBACClient, j as IHeadlessTOTPClient, i as IHeadlessUserClient, ax as IOAuthProvider, ay as IRNHeadlessOAuthClient, az as IRNOAuthProvider, aA as ImpersonationAuthenticateOptions, aB as ImpersonationAuthenticateResponse, aC as MemberInfo, aD as MemberSessionInfo, aE as OAuthAttachResponse, aF as OAuthAuthenticateOptions, aG as OAuthAuthenticateResponse, O as OAuthAuthorizeStartOptions, b as OAuthAuthorizeStartResponse, c as OAuthAuthorizeSubmitOptions, d as OAuthAuthorizeSubmitResponse, aH as OAuthGetURLOptions, e as OAuthLogoutStartOptions, f as OAuthLogoutStartResponse, aI as OAuthStartFailureReason, aJ as OAuthStartResponse, aK as RNOAuthGetURLOptions, aL as RedirectURLType, aM as SCIMConnection, aN as SCIMConnectionWithBearerToken, aO as SCIMConnectionWithNextBearerToken, aP as SCIMGroup, aQ as TOTPAuthenticateOptions, aR as TOTPAuthenticateResponse, aS as TOTPCreateOptions, aT as TOTPCreateResponse, aU as TOTPRecoverOptions, aV as TOTPRecoverResponse, aW as TOTPRecoveryCodesResponse, aX as TokenType, aY as UserGetConnectedAppsResponse, aZ as UserInfo, a_ as UserOnChangeCallback, a$ as UserUpdateOptions, b0 as UserUpdateResponse } from './createAuthUrlHandler-CH6XQXol.js'; import * as react from 'react'; import react__default, { ReactNode, ComponentType } from 'react'; import { S as StytchProduct, a as SDKConfig, I as IDPConsentManifestGenerator, A as AuthTokenParams, D as DeprecatedSDKConfig, b as StytchLoginConfig, P as PresentationConfig } from './themes-BrPsKJhz.js'; export { c as IDPSDKConfig, R as ResetPasswordSDKConfig, d as defaultDarkTheme, e as defaultTheme, i as iconsBlack, f as iconsWhite, s as shadcnTheme } from './themes-BrPsKJhz.js'; import { r as StytchProjectConfiguration, s as Callbacks, t as StringsOptions, a as StytchProjectConfigurationInput, u as Session, U as User, g as StytchClientOptions } from './ui-pc_AYI_4.js'; export { A as AccessTokenExchangeFactor, v as AmazonOAuthFactor, w as AppleOAuthFactor, x as AuthenticateResponse, y as AuthenticationFactor, z as AuthenticatorAppFactor, D as B2BAllowedAuthMethods, E as B2BAllowedMFAMethods, F as B2BAuthenticateResponse, G as B2BAuthenticateResponseWithMFA, H as B2BAuthenticationFactor, J as B2BDiscoveryAuthenticateResponse, K as B2BDiscoveryIntermediateSessionsExchangeOptions, L as B2BDiscoveryIntermediateSessionsExchangeResponse, M as B2BDiscoveryOTPEmailAuthenticateOptions, N as B2BDiscoveryOTPEmailAuthenticateResponse, O as B2BDiscoveryOTPEmailSendOptions, P as B2BDiscoveryOTPEmailSendResponse, Q as B2BDiscoveryOrganizationsCreateOptions, R as B2BDiscoveryOrganizationsCreateResponse, T as B2BDiscoveryOrganizationsResponse, V as B2BEmailFactor, W as B2BGitHubOAuthFactor, X as B2BGoogleOAuthFactor, Y as B2BHubSpotOAuthFactor, Z as B2BImpersonationAuthenticateOptions, _ as B2BImpersonationAuthenticateResponse, $ as B2BMagicLinkLoginOrSignupOptions, a0 as B2BMagicLinkLoginOrSignupResponse, a1 as B2BMagicLinksAuthenticateOptions, a2 as B2BMagicLinksAuthenticateResponse, a3 as B2BMagicLinksDiscoveryAuthenticateOptions, a4 as B2BMagicLinksDiscoveryAuthenticateResponse, a5 as B2BMagicLinksEmailDiscoverySendOptions, a6 as B2BMagicLinksEmailDiscoverySendResponse, a7 as B2BMagicLinksInviteOptions, a8 as B2BMagicLinksInviteResponse, a9 as B2BMicrosoftOAuthFactor, aa as B2BOAuthAuthenticateOptions, ab as B2BOAuthAuthenticateResponse, ac as B2BOAuthDiscoveryAuthenticateResponse, ad as B2BOAuthDiscoveryStartOptions, ae as B2BOTPsEmailAuthenticateOptions, af as B2BOTPsEmailAuthenticateResponse, ag as B2BOTPsEmailLoginOrSignupOptions, ah as B2BOTPsEmailLoginOrSignupResponse, ai as B2BOrganizationsDeleteResponse, aj as B2BOrganizationsGetBySlugOptions, ak as B2BOrganizationsGetBySlugResponse, al as B2BOrganizationsGetConnectedAppOptions, am as B2BOrganizationsGetConnectedAppResponse, an as B2BOrganizationsGetConnectedAppsResponse, ao as B2BOrganizationsMemberDeleteMFAPhoneNumberResponse, ap as B2BOrganizationsMemberDeleteMFATOTPResponse, aq as B2BOrganizationsMemberDeletePasswordResponse, ar as B2BOrganizationsMemberGetConnectedAppsOptions, as as B2BOrganizationsMemberGetConnectedAppsResponse, at as B2BOrganizationsMemberRevokeConnectedAppOptions, au as B2BOrganizationsMemberRevokeConnectedAppResponse, av as B2BOrganizationsMemberStartEmailUpdateOptions, aw as B2BOrganizationsMemberStartEmailUpdateResponse, ax as B2BOrganizationsMemberUnlinkRetiredEmailOptions, ay as B2BOrganizationsMemberUnlinkRetiredEmailResponse, az as B2BOrganizationsMembersCreateOptions, aA as B2BOrganizationsMembersCreateResponse, aB as B2BOrganizationsMembersDeleteResponse, aC as B2BOrganizationsMembersReactivateResponse, aD as B2BOrganizationsMembersSearchOptions, aE as B2BOrganizationsMembersSearchResponse, aF as B2BOrganizationsMembersUpdateOptions, aG as B2BOrganizationsMembersUpdateResponse, aH as B2BOrganizationsUpdateOptions, aI as B2BOrganizationsUpdateResponse, aJ as B2BPasswordAuthenticateOptions, aK as B2BPasswordAuthenticateResponse, aL as B2BPasswordDiscoveryAuthenticateOptions, aM as B2BPasswordDiscoveryAuthenticateResponse, aN as B2BPasswordDiscoveryResetByEmailOptions, aO as B2BPasswordDiscoveryResetByEmailResponse, aP as B2BPasswordDiscoveryResetByEmailStartOptions, aQ as B2BPasswordDiscoveryResetByEmailStartResponse, aR as B2BPasswordResetByEmailOptions, aS as B2BPasswordResetByEmailResponse, aT as B2BPasswordResetByEmailStartOptions, aU as B2BPasswordResetByEmailStartResponse, aV as B2BPasswordResetByExistingPasswordOptions, aW as B2BPasswordResetByExistingPasswordResponse, aX as B2BPasswordResetBySessionOptions, aY as B2BPasswordResetBySessionResponse, aZ as B2BPasswordStrengthCheckOptions, a_ as B2BPasswordStrengthCheckResponse, a$ as B2BPhoneNumberFactor, b0 as B2BSMSAuthenticateOptions, b1 as B2BSMSAuthenticateResponse, b2 as B2BSMSSendOptions, b3 as B2BSMSSendResponse, b4 as B2BSSOCreateExternalConnectionOptions, b5 as B2BSSOCreateExternalConnectionResponse, b6 as B2BSSODeleteConnectionResponse, b7 as B2BSSODiscoverConnectionsResponse, b8 as B2BSSOGetConnectionsResponse, b9 as B2BSSOOIDCCreateConnectionOptions, ba as B2BSSOOIDCCreateConnectionResponse, bb as B2BSSOOIDCUpdateConnectionOptions, bc as B2BSSOOIDCUpdateConnectionResponse, bd as B2BSSOSAMLCreateConnectionOptions, be as B2BSSOSAMLCreateConnectionResponse, bf as B2BSSOSAMLDeleteEncryptionPrivateKeyOptions, bg as B2BSSOSAMLDeleteEncryptionPrivateKeyResponse, bh as B2BSSOSAMLDeleteVerificationCertificateOptions, bi as B2BSSOSAMLDeleteVerificationCertificateResponse, bj as B2BSSOSAMLUpdateConnectionByURLOptions, bk as B2BSSOSAMLUpdateConnectionByURLResponse, bl as B2BSSOSAMLUpdateConnectionOptions, bm as B2BSSOSAMLUpdateConnectionResponse, bn as B2BSSOUpdateExternalConnectionOptions, bo as B2BSSOUpdateExternalConnectionResponse, bp as B2BSlackOAuthFactor, B as B2BState, bq as B2BTOTPAuthenticateOptions, br as B2BTOTPAuthenticateResponse, bs as B2BTOTPCreateOptions, bt as B2BTOTPCreateResponse, bu as BiometricFactor, bv as BiometricRegistrationIdIsNullOrBlank, bw as BiometricsAlreadyEnrolledError, bx as BiometricsFailedError, by as BiometricsUnavailableError, bz as BitbucketOAuthFactor, bA as ChallengeSigningFailedError, bB as CoinbaseOAuthFactor, bC as ConnectedAppPublic, C as ConsumerState, bD as CryptoWalletAuthenticateOptions, bE as CryptoWalletAuthenticateResponse, bF as CryptoWalletAuthenticateStartOptions, bG as CryptoWalletAuthenticateStartResponse, bH as CryptoWalletFactor, bI as DFPNotConfigured, bJ as DeleteResponse, bK as DeviceAttributeDetails, bL as DeviceCredentialsNotAllowedError, bM as DiscordOAuthFactor, bN as DiscoveredOrganization, bO as EmailFactor, bP as EmailMagicLinksOptions, bQ as EncryptionPrivateKey, bR as ExternalConnection, bS as FacebookOAuthFactor, bT as FailedCodeChallengeError, bU as FailedToDecryptDataError, bV as FigmaOAuthFactor, bW as GitLabOAuthFactor, bX as GithubOAuthFactor, bY as GoogleOAuthFactor, bZ as IDPConsentItem, b_ as IDPConsentScreenManifest, b$ as IDPConsentSection, c0 as IDPOAuthFlowMissingParamError, l as IHeadlessB2BDiscoveryClient, q as IHeadlessB2BImpersonationClient, i as IHeadlessB2BMagicLinksClient, h as IHeadlessB2BOAuthClient, n as IHeadlessB2BOTPsClient, j as IHeadlessB2BOrganizationClient, m as IHeadlessB2BPasswordClient, p as IHeadlessB2BRecoveryCodesClient, k as IHeadlessB2BSSOClient, o as IHeadlessB2BTOTPsClient, d as IHeadlessCryptoWalletClient, I as IHeadlessMagicLinksClient, c as IHeadlessOTPsClient, f as IHeadlessPasswordClient, b as IHeadlessSessionClient, e as IHeadlessWebAuthnClient, c1 as InternalError, c2 as InvalidAuthorizationCredentialError, c3 as InvalidCredentialTypeError, c4 as InvalidPrivateKeyLength, c5 as InvalidRedirectSchemeError, c6 as InvalidStartUrlError, c7 as JSONDataNotConvertibleToStringError, c8 as KeyInvalidatedError, c9 as KeystoreUnavailableError, ca as LinkedInOAuthFactor, cb as MagicLinksAuthenticateOptions, cc as MagicLinksAuthenticateResponse, cd as MagicLinksLoginOrCreateOptions, ce as MagicLinksLoginOrCreateResponse, cf as MagicLinksSendOptions, cg as MagicLinksSendResponse, ch as Member, ci as MemberEmailUpdateDeliveryMethod, cj as MemberOptions, ck as MemberResponseCommon, cl as MemberRole, cm as MemberSession, cn as MfaRequired, co as MicrosoftOAuthFactor, cp as MissingAttestationObjectError, cq as MissingAuthorizationCredentialIDTokenError, cr as MissingCipherIv, cs as MissingGoogleClientIDError, ct as MissingPKCEError, cu as MissingPublicKeyError, cv as MissingUrlError, cw as NoBiometricsEnrolledError, cx as NoBiometricsRegistrationError, cy as NoCredentialsPresentError, cz as NoCurrentSessionError, cA as OAuthDiscoveryAuthenticateOptions, cB as OAuthOptions, cC as OAuthProviders, cD as OAuthRegistration, cE as OAuthStartOptions, cF as OIDCConnection, cG as OTPAuthenticateOptions, cH as OTPCodeEmailOptions, cI as OTPCodeOptions, cJ as OTPCodeSMSOptions, cK as OTPMethods, cL as OTPsAuthenticateResponse, cM as OTPsLoginOrCreateResponse, cN as OTPsSendResponse, cO as OneTapPositions, cP as OneTapStyleConfig, cQ as Organization, cR as OrganizationBySlugMatch, cS as OrganizationInfo, cT as OtpOptions, cU as PasskeyOptions, cV as PasskeysInvalidEncoding, cW as PasskeysMisconfigured, cX as PasskeysUnsupportedError, cY as PasswordAuthenticateOptions, cZ as PasswordAuthenticateResponse, c_ as PasswordCreateOptions, c$ as PasswordCreateResponse, d0 as PasswordFactor, d1 as PasswordOptions, d2 as PasswordResetByEmailOptions, d3 as PasswordResetByEmailResponse, d4 as PasswordResetByEmailStartOptions, d5 as PasswordResetByEmailStartResponse, d6 as PasswordResetByExistingPasswordOptions, d7 as PasswordResetByExistingPasswordResponse, d8 as PasswordResetBySessionOptions, d9 as PasswordResetBySessionResponse, da as PasswordStrengthCheckOptions, db as PasswordStrengthCheckResponse, dc as PhoneNumberFactor, dd as PrimaryRequired, de as ProviderOptions, df as ProvidersOptions, dg as RNUIEmailMagicLinksOptions, dh as RNUIOAuthOptions, di as RNUIOTPOptions, dj as RNUIPasswordOptions, dk as RNUIProductConfig, dl as RNUIProducts, dm as RandomNumberGenerationFailed, dn as RecoveryCodeFactor, dp as RecoveryCodeGetResponse, dq as RecoveryCodeRecoverOptions, dr as RecoveryCodeRecoverResponse, ds as RecoveryCodeRotateResponse, dt as ResponseCommon, du as RetiredEmailAddress, dv as SAMLConnection, dw as SDKAPIUnreachableError, dx as SDKDeviceHistory, dy as SDKNotConfiguredError, dz as SIWEParams, dA as SSOActiveConnection, dB as SSOAuthenticateOptions, dC as SSOAuthenticateResponse, dD as SSOStartOptions, dE as SalesforceOAuthFactor, dF as ScopeResult, dG as SearchQueryOperand, dH as SessionAccessTokenExchangeOptions, dI as SessionAccessTokenExchangeResponse, dJ as SessionAttestOptions, dK as SessionAttestResponse, dL as SessionAuthenticateOptions, dM as SessionAuthenticateResponse, dN as SessionDurationOptions, dO as SessionInfo, dP as SessionOnChangeCallback, dQ as SessionOptions, dR as SessionRevokeOptions, dS as SessionRevokeResponse, dT as SessionTokens, dU as SessionTokensUpdate, dV as SignInWithAppleMisconfigured, dW as SlackOAuthFactor, dX as SnapchatOAuthFactor, S as StyleConfig, dY as StytchAPIError, dZ as StytchAPISchemaError, d_ as StytchAPIUnreachableError, d$ as StytchError, e0 as StytchEvent, e1 as StytchEventType, e2 as StytchSDKAPIError, e3 as StytchSDKError, e4 as StytchSDKErrorOptions, e5 as StytchSDKSchemaError, e6 as StytchSDKUIError, e7 as StytchSDKUsageError, e8 as TikTokOAuthFactor, e9 as TwitchOAuthFactor, ea as TwitterOAuthFactor, eb as UNRECOVERABLE_ERROR_TYPES, ec as UnsubscribeFunction, ed as UpdateResponse, ee as UserCancellationError, ef as UserLockedOutError, eg as Wallets, eh as WebAuthnAuthenticateResponse, ei as WebAuthnAuthenticateStartOptions, ej as WebAuthnAuthenticateStartResponse, ek as WebAuthnFactor, el as WebAuthnRegisterResponse, em as WebAuthnRegisterStartOptions, en as WebAuthnRegisterStartResponse, eo as WebAuthnRegistration, ep as WebAuthnUpdateOptions, eq as WebAuthnUpdateResponse, er as X509Certificate, es as YahooOAuthFactor, et as errorToStytchError, eu as locale } from './ui-pc_AYI_4.js'; import { S as StytchClient } from './StytchClient-gn1ElJRA.js'; export { I as IconRegistry, P as PresentationOptions, T as Theme } from './PresentationConfig-rSvBlImP.js'; export { O as OAuthAuthorizeParams, a as OAuthLogoutParams, p as parseOAuthAuthorizeParams, b as parseOAuthLogoutParams } from './idpHelpers-CewlCaGG.js'; import './StytchB2BClient-79JK1KWk.js'; declare const emailMagicLinks: StytchProduct; declare const oauth: StytchProduct; declare const otp: StytchProduct; declare const passwords: StytchProduct; declare const passkeys: StytchProduct; declare const passkeyRegistration: StytchProduct; declare const crypto: StytchProduct; declare const Products_crypto: typeof crypto; declare const Products_emailMagicLinks: typeof emailMagicLinks; declare const Products_oauth: typeof oauth; declare const Products_otp: typeof otp; declare const Products_passkeyRegistration: typeof passkeyRegistration; declare const Products_passkeys: typeof passkeys; declare const Products_passwords: typeof passwords; declare namespace Products { export { Products_crypto as crypto, Products_emailMagicLinks as emailMagicLinks, Products_oauth as oauth, Products_otp as otp, Products_passkeyRegistration as passkeyRegistration, Products_passkeys as passkeys, Products_passwords as passwords, }; } declare const IdentityProvider: react.ComponentType>, "client" | "presentation" | "callbacks" | "strings"> & { getIDPConsentManifest?: IDPConsentManifestGenerator; authTokenParams?: AuthTokenParams; } & DeprecatedSDKConfig, "client">>; declare const StytchLogin: react.ComponentType>; config: StytchLoginConfig; presentation?: PresentationConfig; callbacks?: Callbacks> | undefined; } & StringsOptions & DeprecatedSDKConfig, "client">>; declare const StytchPasskeyRegistration: react.ComponentType>; config: StytchLoginConfig; presentation?: PresentationConfig; callbacks?: Callbacks> | undefined; } & StringsOptions & DeprecatedSDKConfig, "client">>; declare const StytchPasswordReset: react.ComponentType>; config: StytchLoginConfig; presentation?: PresentationConfig; callbacks?: Callbacks> | undefined; } & StringsOptions & { passwordResetToken?: string; } & DeprecatedSDKConfig, "client">>; interface StytchProps extends StringsOptions { /** * A {@link StytchLoginConfig} object. Add products and product-specific config to this object to change the login methods shown. * * @example * { * products: [Products.crypto, Products.otp] * } * * @example * { * products: [Products.emailMagicLinks] * emailMagicLinksOptions: { * loginRedirectURL: 'https://example.com/authenticate', * signupRedirectURL: 'https://example.com/authenticate', * } * } * * @example * { * products: [Products.oauth] * oauthOptions: { * providers: [ * { type: 'google', one_tap: true, position: 'embedded' }, * { type: 'microsoft' }, * { type: 'apple' }, * { type: 'facebook' }, * ], * } * } */ config: StytchLoginConfig; /** * An optional {@link PresentationConfig} to customize the UI presentation. */ presentation?: PresentationConfig; /** * An optional {@link Callbacks} object. * * @example * { * onError: ({message}) => { * console.error('Stytch login screen error', message) * } * } * * @example * { * onEvent: ({type, data}) => { * if(type === StytchEventType.CryptoWalletAuthenticate) { * console.log('Logged in with crypto wallet', data); * } * } * } */ callbacks?: Callbacks; } type IdentityProviderProps = Omit & { /** * Optional {@link IDPConsentManifestGenerator} to customize the consent screen. */ getIDPConsentManifest?: IDPConsentManifestGenerator; /** * Optional {@link AuthTokenParams} to provide a trusted auth token to provide for attestation prior to running OAuth flow. */ authTokenParams?: AuthTokenParams; }; type SWRUserUninitialized = { /** * Either the active {@link User} object, or null if the user is not logged in. */ user: null; /** * If true, indicates that the value returned is from the application cache and a state refresh is in progress. */ fromCache: false; /** * If true, indicates that the SDK has completed initialization. */ isInitialized: false; }; type SWRUserInitialized = { /** * Either the active {@link User} object, or null if the user is not logged in. */ user: User | null; /** * If true, indicates that the value returned is from the application cache and a state refresh is in progress. */ fromCache: boolean; /** * If true, indicates that the SDK has completed initialization. */ isInitialized: true; }; type SWRUser = TAlwaysInitialized extends true ? SWRUserInitialized : SWRUserInitialized | SWRUserUninitialized; type SWRSessionUninitialized = { /** * Either the active {@link Session} object, or null if the user is not logged in. */ session: null; /** * If true, indicates that the value returned is from the application cache and a state refresh is in progress. */ fromCache: false; /** * If true, indicates that the SDK has completed initialization. */ isInitialized: false; }; type SWRSessionInitialized = { /** * Either the active {@link Session} object, or null if the user is not logged in. */ session: Session | null; /** * If true, indicates that the value returned is from the application cache and a state refresh is in progress. */ fromCache: boolean; /** * If true, indicates that the SDK has completed initialization. */ isInitialized: true; }; type SWRSession = TAlwaysInitialized extends true ? SWRSessionInitialized : SWRSessionInitialized | SWRSessionUninitialized; /** * Returns the active User. * The Stytch SDKs are used for client-side authentication and session management. * Check the isInitialized property to determine if the SDK has completed initialization. * Check the fromCache property to determine if the user data is from persistent storage. * @example * const {user, isInitialized, fromCache} = useStytchUser(); * if (!isInitialized) { * return

Loading...

; * } * return (

Welcome, {user.name.first_name}

); */ declare const useStytchUser: () => SWRUser; /** * Returns the active user's Stytch session. * The Stytch SDKs are used for client-side authentication and session management. * Check the isInitialized property to determine if the SDK has completed initialization. * Check the fromCache property to determine if the session data is from persistent storage. * @example * const {session, isInitialized, fromCache} = useStytchSession(); * useEffect(() => { * if (!isInitialized) { * return; * } * if (!session) { * router.replace('/login') * } * }, [session, isInitialized]); */ declare const useStytchSession: () => SWRSession; /** * Returns the Stytch client stored in the Stytch context. * * @example * const stytch = useStytch(); * useEffect(() => { * stytch.magicLinks.authenticate('...') * }, [stytch]); */ declare const useStytch: () => StytchClient; declare const withStytch: (Component: ComponentType; }>) => ComponentType; declare const withStytchUser: (Component: ComponentType) => ComponentType; declare const withStytchSession: (Component: ComponentType) => ComponentType; type SWRIsAuthorizedUninitialized = { /** * Whether the logged-in user is allowed to perform the specified action on the specified resource. */ isAuthorized: false; /** * If true, indicates that the value returned is from the application cache and a state refresh is in progress. */ fromCache: false; /** * If true, indicates that the SDK has completed initialization. */ isInitialized: false; }; type SWRIsAuthorizedInitialized = { /** * Whether the logged-in user is allowed to perform the specified action on the specified resource. */ isAuthorized: boolean; /** * If true, indicates that the value returned is from the application cache and a state refresh is in progress. */ fromCache: boolean; /** * If true, indicates that the SDK has completed initialization. */ isInitialized: boolean; }; type SWRIsAuthorized = TAlwaysInitialized extends true ? SWRIsAuthorizedInitialized : SWRIsAuthorizedInitialized | SWRIsAuthorizedUninitialized; /** * Determines whether the logged-in user is allowed to perform the specified action on the specified resource. * Returns `true` if the user can perform the action, `false` otherwise. * * If the user is not logged in, this method will always return false. * If the resource or action provided are not valid for the configured RBAC policy, this method will return false. * * Remember - authorization checks for sensitive actions should always occur on the backend as well. * @example * const { isAuthorized } = useStytchIsAuthorized('documents', 'edit'); * return */ declare const useStytchIsAuthorized: (resourceId: string, action: string) => SWRIsAuthorized; /** * Wrap your component with this HOC in order to receive the permissions for the logged-in user. * Evaluates all permissions granted to the logged-in user. * Returns a Record> response indicating the user's permissions. * Each boolean will be `true` if the user can perform the action, `false` otherwise. * * If the user is not logged in, all values will be false. * * Remember - authorization checks for sensitive actions should always occur on the backend as well. * @example * type Permissions = { * document: 'create' | 'read' | 'write * image: 'create' | 'read' * } * * const MyComponent = (props) => { * const canEditDocuments = props.stytchPermissions.document.edit; * const canReadImages = props.stytchPermissions.image.read; * } * return withStytchPermissions(MyComponent) */ declare const withStytchPermissions: , T extends object>(Component: ComponentType; }>) => ComponentType; interface StytchProviderProps { /** * A Stytch client instance, created using either {@link createStytchHeadlessClient} or {@link createStytchClient} */ stytch: StytchClient; /** * When true, the provider will assume that the component will only be * rendered in a browser environment, either in a single-page application or * after completing hydration of a server-rendered application. This allows * cached values to be retrieved from the browser on the first render, meaning * that the `isInitialized` value returned from Stytch hooks will be `true` * starting from the first render. * * When `false`, the provider will defer initialization until after the first * render, and `isInitialized` will initially be `false`. * * This value defaults to `false` in `@stytch/nextjs`. */ assumeHydrated?: boolean; children?: ReactNode; } /** * The Stytch Context Provider. * Wrap your application with this component in order to use Stytch everywhere in your app. * @example * const stytch = createStytchClient('public-token-') * * return ( * * * * ) */ declare const StytchProvider: ({ stytch, children, assumeHydrated, }: StytchProviderProps) => react__default.JSX.Element; interface StytchResetPasswordProps extends StytchProps { /** * A Stytch password reset token. */ passwordResetToken: string; } /** * @deprecated - use {@link createStytchClient} instead */ declare const createStytchUIClient: (publicTokenRaw: string, options?: StytchClientOptions | undefined) => StytchClient; export { AuthTokenParams, Callbacks, IDPConsentManifestGenerator, IdentityProvider, PermissionsMap, PresentationConfig, Products, SDKConfig, Session, StringsOptions, StytchClient, StytchClientOptions, StytchLogin, StytchLoginConfig, StytchPasskeyRegistration, StytchPasswordReset, StytchProjectConfiguration, StytchProjectConfigurationInput, StytchProvider, User, createStytchUIClient, useStytch, useStytchIsAuthorized, useStytchSession, useStytchUser, withStytch, withStytchPermissions, withStytchSession, withStytchUser }; export type { IdentityProviderProps, StytchProps, StytchProviderProps, StytchResetPasswordProps };