@stytch/vanilla-js 4.12.2 → 4.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/b2b/adminPortal/package.json +6 -0
- package/dist/APINetworkClient.d.ts +6 -0
- package/dist/BootstrapDataManager.d.ts +38 -0
- package/dist/CaptchaProvider.d.ts +7 -0
- package/dist/ClientsideServicesProvider.d.ts +16 -0
- package/dist/HeadlessOAuthClient.d.ts +68 -0
- package/dist/NetworkClient.d.ts +25 -0
- package/dist/PKCEManager.d.ts +12 -0
- package/dist/StytchHeadlessClient.d.ts +45 -0
- package/dist/StytchUIClient.d.ts +86 -0
- package/dist/SubscriptionService.d.ts +111 -0
- package/dist/adminPortal/AdminPortalStyleConfig.d.ts +166 -0
- package/dist/adminPortal/AdminPortalWrapper.d.ts +6 -0
- package/dist/adminPortal/MainContainer.d.ts +4 -0
- package/dist/adminPortal/Router.d.ts +44 -0
- package/dist/adminPortal/StytchClientContext.d.ts +3 -0
- package/dist/adminPortal/components/Accordion.d.ts +6 -0
- package/dist/adminPortal/components/ActionMenu.d.ts +22 -0
- package/dist/adminPortal/components/Alert.d.ts +4 -0
- package/dist/adminPortal/components/Button.d.ts +6 -0
- package/dist/adminPortal/components/Code.d.ts +7 -0
- package/dist/adminPortal/components/CopyableText.d.ts +7 -0
- package/dist/adminPortal/components/DeleteConnection.d.ts +21 -0
- package/dist/adminPortal/components/EmbeddedTable.d.ts +3 -0
- package/dist/adminPortal/components/FlexBox.d.ts +1 -0
- package/dist/adminPortal/components/InfoIcon.d.ts +3 -0
- package/dist/adminPortal/components/Input.d.ts +5 -0
- package/dist/adminPortal/components/Label.d.ts +4 -0
- package/dist/adminPortal/components/ListEditor.d.ts +4 -0
- package/dist/adminPortal/components/MenuItem.d.ts +4 -0
- package/dist/adminPortal/components/Modal.d.ts +16 -0
- package/dist/adminPortal/components/PageLoadingIndicator.d.ts +2 -0
- package/dist/adminPortal/components/PaginatedTable.d.ts +4 -0
- package/dist/adminPortal/components/SearchBar.d.ts +3 -0
- package/dist/adminPortal/components/Select.d.ts +12 -0
- package/dist/adminPortal/components/SetDefaultConnection.d.ts +29 -0
- package/dist/adminPortal/components/SettingsContainer.d.ts +24 -0
- package/dist/adminPortal/components/SettingsList.d.ts +4 -0
- package/dist/adminPortal/components/SettingsListItem.d.ts +5 -0
- package/dist/adminPortal/components/SettingsSection.d.ts +6 -0
- package/dist/adminPortal/components/Table.d.ts +3 -0
- package/dist/adminPortal/components/TableActions.d.ts +5 -0
- package/dist/adminPortal/components/Tag.d.ts +5 -0
- package/dist/adminPortal/components/TagList.d.ts +4 -0
- package/dist/adminPortal/components/Toast.d.ts +5 -0
- package/dist/adminPortal/components/Tooltip.d.ts +2 -0
- package/dist/adminPortal/components/Typography.d.ts +4 -0
- package/dist/adminPortal/index.d.ts +3 -0
- package/dist/adminPortal/index.esm.js +5 -0
- package/dist/adminPortal/index.js +5 -0
- package/dist/adminPortal/makeAdminPortalComponentMountFn.d.ts +19 -0
- package/dist/adminPortal/shared/components/Accordion.d.ts +15 -0
- package/dist/adminPortal/shared/components/Button.d.ts +25 -0
- package/dist/adminPortal/shared/components/Code.d.ts +14 -0
- package/dist/adminPortal/shared/components/ContentSpacing.d.ts +6 -0
- package/dist/adminPortal/shared/components/CopyableText.d.ts +16 -0
- package/dist/adminPortal/shared/components/EmbeddedTable.d.ts +16 -0
- package/dist/adminPortal/shared/components/FlexBox.d.ts +11 -0
- package/dist/adminPortal/shared/components/InfoIcon.d.ts +7 -0
- package/dist/adminPortal/shared/components/Input.d.ts +28 -0
- package/dist/adminPortal/shared/components/Label.d.ts +10 -0
- package/dist/adminPortal/shared/components/ListEditor.d.ts +27 -0
- package/dist/adminPortal/shared/components/MenuItem.d.ts +14 -0
- package/dist/adminPortal/shared/components/Modal.d.ts +20 -0
- package/dist/adminPortal/shared/components/PaginatedTable.d.ts +30 -0
- package/dist/adminPortal/shared/components/SearchBar.d.ts +6 -0
- package/dist/adminPortal/shared/components/Select.d.ts +30 -0
- package/dist/adminPortal/shared/components/Table.d.ts +17 -0
- package/dist/adminPortal/shared/components/TableActions.d.ts +15 -0
- package/dist/adminPortal/shared/components/Tag.d.ts +4 -0
- package/dist/adminPortal/shared/components/Toast.d.ts +18 -0
- package/dist/adminPortal/shared/components/Tooltip.d.ts +12 -0
- package/dist/adminPortal/shared/components/Typography.d.ts +15 -0
- package/dist/adminPortal/shared/components/componentInjection.d.ts +48 -0
- package/dist/adminPortal/shared/components/constants.d.ts +3 -0
- package/dist/adminPortal/shared/components/types.d.ts +13 -0
- package/dist/adminPortal/shared/utils/clickToCopyUtils.d.ts +15 -0
- package/dist/adminPortal/shared/utils/composeStyles.d.ts +60 -0
- package/dist/adminPortal/shared/utils/keys.d.ts +74 -0
- package/dist/adminPortal/shared/utils/noop.d.ts +1 -0
- package/dist/adminPortal/shared/utils/tableUtils.d.ts +3 -0
- package/dist/adminPortal/shared/utils/uniqueIds.d.ts +2 -0
- package/dist/adminPortal/shared/utils/useToggleState.d.ts +7 -0
- package/dist/adminPortal/sso/AdminPortalSSO.d.ts +18 -0
- package/dist/adminPortal/sso/AppDetails.d.ts +5 -0
- package/dist/adminPortal/sso/AttributeMappingTable.d.ts +22 -0
- package/dist/adminPortal/sso/DetailsSection.d.ts +6 -0
- package/dist/adminPortal/sso/IdpInfo.d.ts +147 -0
- package/dist/adminPortal/sso/IdpSelect.d.ts +126 -0
- package/dist/adminPortal/sso/OrganizationUpdatesSection.d.ts +7 -0
- package/dist/adminPortal/sso/RoleAssignmentsSection.d.ts +6 -0
- package/dist/adminPortal/sso/SSOConnectionDetailsScreen.d.ts +4 -0
- package/dist/adminPortal/sso/SSOConnectionsScreen.d.ts +2 -0
- package/dist/adminPortal/sso/SSONewConnectionConfigureScreen.d.ts +5 -0
- package/dist/adminPortal/sso/SSONewConnectionScreen.d.ts +2 -0
- package/dist/adminPortal/sso/SSORouter.d.ts +44 -0
- package/dist/adminPortal/sso/TaggedConnection.d.ts +8 -0
- package/dist/adminPortal/sso/mountAdminPortalSSO.d.ts +15 -0
- package/dist/adminPortal/sso/useDisplayPagination.d.ts +14 -0
- package/dist/adminPortal/utils/Connection.d.ts +9 -0
- package/dist/adminPortal/utils/ConnectionType.d.ts +1 -0
- package/dist/adminPortal/utils/clickToCopyUtils.d.ts +5 -0
- package/dist/adminPortal/utils/collator.d.ts +1 -0
- package/dist/adminPortal/utils/organizationGetKey.d.ts +1 -0
- package/dist/adminPortal/utils/theme.d.ts +6 -0
- package/dist/adminPortal/utils/useAdminPortalConfig.d.ts +10 -0
- package/dist/adminPortal/utils/useApiNetworkClient.d.ts +2 -0
- package/dist/adminPortal/utils/useB2BInternals.d.ts +1 -0
- package/dist/adminPortal/utils/useFormState.d.ts +13 -0
- package/dist/adminPortal/utils/useMutateOrganization.d.ts +4 -0
- package/dist/adminPortal/utils/useMutateSsoConnection.d.ts +19 -0
- package/dist/adminPortal/utils/useMutateWithToast.d.ts +7 -0
- package/dist/adminPortal/utils/useNavigateAwayWarning.d.ts +1 -0
- package/dist/adminPortal/utils/useOrgInfo.d.ts +1 -0
- package/dist/adminPortal/utils/useRbac.d.ts +51 -0
- package/dist/adminPortal/utils/useRevalidateConnectionList.d.ts +1 -0
- package/dist/adminPortal/utils/useSsoConnections.d.ts +2 -0
- package/dist/adminPortal/utils/useStateSliceSetter.d.ts +2 -0
- package/dist/adminPortal/utils/useStytchClient.d.ts +1 -0
- package/dist/assets/CreateIcon.d.ts +6 -0
- package/dist/assets/amazon.d.ts +3 -0
- package/dist/assets/apple.d.ts +3 -0
- package/dist/assets/backArrow.d.ts +5 -0
- package/dist/assets/binance.d.ts +3 -0
- package/dist/assets/bitbucket.d.ts +3 -0
- package/dist/assets/check.d.ts +2 -0
- package/dist/assets/checkmark.d.ts +2 -0
- package/dist/assets/chevron.d.ts +3 -0
- package/dist/assets/coinbase.d.ts +4 -0
- package/dist/assets/confirmation.d.ts +2 -0
- package/dist/assets/copy.d.ts +3 -0
- package/dist/assets/cross.d.ts +2 -0
- package/dist/assets/discord.d.ts +3 -0
- package/dist/assets/errorIcon.d.ts +3 -0
- package/dist/assets/facebook.d.ts +3 -0
- package/dist/assets/figma.d.ts +3 -0
- package/dist/assets/genericWallet.d.ts +4 -0
- package/dist/assets/github.d.ts +3 -0
- package/dist/assets/gitlab.d.ts +3 -0
- package/dist/assets/gmail.d.ts +3 -0
- package/dist/assets/google.d.ts +3 -0
- package/dist/assets/linkedin.d.ts +3 -0
- package/dist/assets/metamask.d.ts +4 -0
- package/dist/assets/microsoft.d.ts +3 -0
- package/dist/assets/outlook.d.ts +3 -0
- package/dist/assets/passkeyAdded.d.ts +2 -0
- package/dist/assets/passkeys.d.ts +3 -0
- package/dist/assets/passkeysCollage.d.ts +2 -0
- package/dist/assets/passwordIcon.d.ts +5 -0
- package/dist/assets/pencil.d.ts +2 -0
- package/dist/assets/phantom.d.ts +3 -0
- package/dist/assets/salesforce.d.ts +3 -0
- package/dist/assets/slack.d.ts +3 -0
- package/dist/assets/snackbarError.d.ts +2 -0
- package/dist/assets/snackbarSuccess.d.ts +2 -0
- package/dist/assets/snapchat.d.ts +3 -0
- package/dist/assets/successIcon.d.ts +3 -0
- package/dist/assets/tiktok.d.ts +3 -0
- package/dist/assets/trash.d.ts +2 -0
- package/dist/assets/twitch.d.ts +3 -0
- package/dist/assets/twitter.d.ts +3 -0
- package/dist/assets/vessel.d.ts +4 -0
- package/dist/assets/warningIcon.d.ts +3 -0
- package/dist/assets/yahoo.d.ts +3 -0
- package/dist/assets/yahooLogo.d.ts +3 -0
- package/dist/b2b/HeadlessB2BOAuthClient.d.ts +100 -0
- package/dist/b2b/StytchB2BHeadlessClient.d.ts +51 -0
- package/dist/b2b/StytchB2BUIClient.d.ts +40 -0
- package/dist/b2b/index.d.ts +1 -189
- package/dist/b2b/index.esm.js +5598 -13879
- package/dist/b2b/index.headless.d.ts +1 -148
- package/dist/b2b/index.headless.esm.js +2 -5269
- package/dist/b2b/index.headless.js +98 -5253
- package/dist/b2b/index.js +5722 -13890
- package/dist/b2b/oneTap/B2BOneTapProvider.d.ts +39 -0
- package/dist/extractErrorMessage-Dg5V9q2V.js +4534 -0
- package/dist/extractErrorMessage-HqH3v6mm.js +4493 -0
- package/dist/index.d.ts +1 -187
- package/dist/index.esm.js +1 -14827
- package/dist/index.headless-BMU_pBP_.js +1691 -0
- package/dist/index.headless-Hm4-qWxa.js +1695 -0
- package/dist/index.headless.d.ts +1 -103
- package/dist/index.headless.esm.js +5086 -3920
- package/dist/index.headless.js +5135 -3907
- package/dist/index.js +1 -14807
- package/dist/internal-BNX5AEoW.js +5196 -0
- package/dist/internal-CfUZ681R.js +5106 -0
- package/dist/oneTap/OneTapClient.d.ts +22 -0
- package/dist/oneTap/OneTapProvider.d.ts +36 -0
- package/dist/oneTap/navigatorSupportsFedCM.d.ts +1 -0
- package/dist/oneTap/positionModes.d.ts +6 -0
- package/dist/types.d.ts +18 -0
- package/dist/ui/CreateWebComponent.d.ts +20 -0
- package/dist/ui/b2b/App.d.ts +5 -0
- package/dist/ui/b2b/Container.d.ts +2 -0
- package/dist/ui/b2b/GlobalContextProvider.d.ts +82 -0
- package/dist/ui/b2b/MfaState.d.ts +50 -0
- package/dist/ui/b2b/clearStytchSearchParams.d.ts +1 -0
- package/dist/ui/b2b/generateProductComponentsOrdering.d.ts +13 -0
- package/dist/ui/b2b/getEnabledMethods.d.ts +5 -0
- package/dist/ui/b2b/hooks/useIsOnlyFloatingOneTap.d.ts +1 -0
- package/dist/ui/b2b/mfa.d.ts +70 -0
- package/dist/ui/b2b/reducer.d.ts +25 -0
- package/dist/ui/b2b/screens/Discovery.d.ts +2 -0
- package/dist/ui/b2b/screens/EmailConfirmation.d.ts +2 -0
- package/dist/ui/b2b/screens/MFAEnrollmentSelectionScreen.d.ts +2 -0
- package/dist/ui/b2b/screens/MagicLinkForm.d.ts +3 -0
- package/dist/ui/b2b/screens/Main.d.ts +2 -0
- package/dist/ui/b2b/screens/OAuthButtons.d.ts +15 -0
- package/dist/ui/b2b/screens/PasswordAuthenticate.d.ts +7 -0
- package/dist/ui/b2b/screens/PasswordEmailForm.d.ts +2 -0
- package/dist/ui/b2b/screens/PasswordForgotForm.d.ts +2 -0
- package/dist/ui/b2b/screens/PasswordResetConfirmation.d.ts +2 -0
- package/dist/ui/b2b/screens/PasswordResetForm.d.ts +2 -0
- package/dist/ui/b2b/screens/PasswordSetNew.d.ts +2 -0
- package/dist/ui/b2b/screens/PasswordUseButton.d.ts +2 -0
- package/dist/ui/b2b/screens/RecoveryCodeEntryScreen.d.ts +2 -0
- package/dist/ui/b2b/screens/RecoveryCodeSaveScreen.d.ts +2 -0
- package/dist/ui/b2b/screens/SMSOTPEnrollScreen.d.ts +3 -0
- package/dist/ui/b2b/screens/SMSOTPEntryScreen.d.ts +2 -0
- package/dist/ui/b2b/screens/SSOButtons.d.ts +6 -0
- package/dist/ui/b2b/screens/TOTPEnrollManualScreen.d.ts +2 -0
- package/dist/ui/b2b/screens/TOTPEnrollQRScreen.d.ts +2 -0
- package/dist/ui/b2b/screens/TOTPEntryScreen.d.ts +2 -0
- package/dist/ui/b2b/utils.d.ts +34 -0
- package/dist/ui/b2c/App.d.ts +11 -0
- package/dist/ui/b2c/Container.d.ts +2 -0
- package/dist/ui/b2c/GlobalContextProvider.d.ts +83 -0
- package/dist/ui/b2c/reducer.d.ts +23 -0
- package/dist/ui/b2c/screens/Crypto/ConnectWallet.d.ts +2 -0
- package/dist/ui/b2c/screens/Crypto/Error.d.ts +2 -0
- package/dist/ui/b2c/screens/Crypto/OtherWallets.d.ts +2 -0
- package/dist/ui/b2c/screens/Crypto/PasskeyConfirmation.d.ts +2 -0
- package/dist/ui/b2c/screens/Crypto/SetupNewWallet.d.ts +2 -0
- package/dist/ui/b2c/screens/Crypto/SignMessage.d.ts +2 -0
- package/dist/ui/b2c/screens/Crypto/Success.d.ts +2 -0
- package/dist/ui/b2c/screens/Crypto/WalletButtons.d.ts +4 -0
- package/dist/ui/b2c/screens/Main/LoginForm/MagicLinkForm.d.ts +2 -0
- package/dist/ui/b2c/screens/Main/LoginForm/OTPForm.d.ts +16 -0
- package/dist/ui/b2c/screens/Main/LoginForm/PasskeyButton.d.ts +2 -0
- package/dist/ui/b2c/screens/Main/LoginForm/PasswordForm.d.ts +2 -0
- package/dist/ui/b2c/screens/Main/LoginForm/index.d.ts +2 -0
- package/dist/ui/b2c/screens/Main/OAuthButtons.d.ts +2 -0
- package/dist/ui/b2c/screens/Main/index.d.ts +2 -0
- package/dist/ui/b2c/screens/Passkey/PasskeyRegistrationStart.d.ts +2 -0
- package/dist/ui/b2c/screens/Passkey/PasskeyRegistrationSuccess.d.ts +2 -0
- package/dist/ui/b2c/screens/Password/MagicLinkOption.d.ts +2 -0
- package/dist/ui/b2c/screens/Password/PasswordAuthenticate.d.ts +2 -0
- package/dist/ui/b2c/screens/Password/PasswordBreached.d.ts +2 -0
- package/dist/ui/b2c/screens/Password/PasswordDedupe.d.ts +2 -0
- package/dist/ui/b2c/screens/Password/PasswordForgot.d.ts +2 -0
- package/dist/ui/b2c/screens/Password/PasswordNewUser.d.ts +2 -0
- package/dist/ui/b2c/screens/Password/PasswordSecondaryMethod.d.ts +4 -0
- package/dist/ui/b2c/screens/Password/PasswordSetNew.d.ts +2 -0
- package/dist/ui/b2c/screens/Password/PasswordlessCreate.d.ts +2 -0
- package/dist/ui/b2c/screens/Password/ResetPassword.d.ts +2 -0
- package/dist/ui/b2c/screens/Secondary/EmailConfirmation.d.ts +6 -0
- package/dist/ui/b2c/screens/Secondary/OTPAuthenticate.d.ts +4 -0
- package/dist/ui/b2c/screens/Secondary/OTPConfirmation.d.ts +2 -0
- package/dist/ui/b2c/screens/Secondary/PasswordCreateAuthenticate.d.ts +2 -0
- package/dist/ui/b2c/utils.d.ts +1 -0
- package/dist/ui/components/AlertBox.d.ts +8 -0
- package/dist/ui/components/AnimatedContainer.d.ts +5 -0
- package/dist/ui/components/B2BOneTap.d.ts +2 -0
- package/dist/ui/components/Button.d.ts +5 -0
- package/dist/ui/components/CircularProgress.d.ts +12 -0
- package/dist/ui/components/Confirmation.d.ts +2 -0
- package/dist/ui/components/CountrySelector.d.ts +7 -0
- package/dist/ui/components/Divider.d.ts +2 -0
- package/dist/ui/components/EditableRow.d.ts +15 -0
- package/dist/ui/components/EmailConfirmation.d.ts +11 -0
- package/dist/ui/components/EmailInput.d.ts +7 -0
- package/dist/ui/components/ErrorScreen.d.ts +2 -0
- package/dist/ui/components/ErrorText.d.ts +4 -0
- package/dist/ui/components/Flex.d.ts +40 -0
- package/dist/ui/components/InlineButton.d.ts +7 -0
- package/dist/ui/components/Input.d.ts +1 -0
- package/dist/ui/components/InsetContainer.d.ts +1 -0
- package/dist/ui/components/Loading.d.ts +3 -0
- package/dist/ui/components/LoadingBar.d.ts +4 -0
- package/dist/ui/components/MainContainer.d.ts +3 -0
- package/dist/ui/components/OAuthB2BButton.d.ts +14 -0
- package/dist/ui/components/OAuthButton.d.ts +14 -0
- package/dist/ui/components/OTPControl.d.ts +8 -0
- package/dist/ui/components/OTPEntry.d.ts +11 -0
- package/dist/ui/components/OTPInput.d.ts +6 -0
- package/dist/ui/components/OneTap.d.ts +18 -0
- package/dist/ui/components/OneTapErrorMessages.d.ts +7 -0
- package/dist/ui/components/PasswordError.d.ts +17 -0
- package/dist/ui/components/PasswordInput.d.ts +6 -0
- package/dist/ui/components/PasswordStrengthCheck.d.ts +4 -0
- package/dist/ui/components/PhoneInput.d.ts +10 -0
- package/dist/ui/components/SentOTPEntry.d.ts +10 -0
- package/dist/ui/components/Snackbar.d.ts +2 -0
- package/dist/ui/components/SubmitButton.d.ts +8 -0
- package/dist/ui/components/TOTPEntry.d.ts +8 -0
- package/dist/ui/components/Text.d.ts +9 -0
- package/dist/ui/components/VerifyEmailConfirmation.d.ts +10 -0
- package/dist/ui/components/WalletButton.d.ts +8 -0
- package/dist/ui/hooks/useIsMounted.d.ts +3 -0
- package/dist/ui/hooks/useIsOnlyFloatingOneTap.d.ts +1 -0
- package/dist/ui/hooks/usePromptPasskey.d.ts +7 -0
- package/dist/ui/theme.d.ts +112 -0
- package/dist/utils/Optional.d.ts +3 -0
- package/dist/utils/assertUnreachable.d.ts +1 -0
- package/dist/utils/crypto.d.ts +60 -0
- package/dist/utils/deepEqual.d.ts +1 -0
- package/dist/utils/extractErrorMessage.d.ts +1 -0
- package/dist/utils/extractErrorType.d.ts +1 -0
- package/dist/utils/index.d.ts +28 -0
- package/dist/utils/internal.d.ts +34 -0
- package/dist/utils/isTruthy.d.ts +3 -0
- package/dist/utils/oauthProviderType.d.ts +7 -0
- package/dist/utils/passkeys.d.ts +8 -0
- package/package.json +19 -17
- package/dist/b2b/index.esm.d.ts +0 -190
- package/dist/b2b/index.headless.esm.d.ts +0 -149
- package/dist/index.esm.d.ts +0 -188
- package/dist/index.headless.esm.d.ts +0 -104
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { StateChangeRegisterFunction } from "@stytch/core";
|
|
2
|
-
import { IHeadlessB2BDiscoveryClient, IHeadlessB2BMagicLinksClient, IHeadlessB2BMemberClient, IHeadlessB2BSelfClient, IHeadlessB2BOrganizationClient, IHeadlessB2BOTPsClient, IHeadlessB2BTOTPsClient, IHeadlessB2BSessionClient, IHeadlessB2BSSOClient, IHeadlessB2BRecoveryCodesClient, IHeadlessB2BRBACClient, StytchClientOptions, B2BState, IHeadlessB2BPasswordClient, IHeadlessB2BOAuthClient } from "@stytch/core/public";
|
|
3
|
-
import { PromptMomentNotification } from "google-one-tap";
|
|
4
|
-
type OneTapNotShownReason = ReturnType<PromptMomentNotification["getNotDisplayedReason"]> | ReturnType<PromptMomentNotification["getSkippedReason"]>;
|
|
5
|
-
type OneTapRenderResult = {
|
|
6
|
-
success: true;
|
|
7
|
-
} | {
|
|
8
|
-
success: false;
|
|
9
|
-
reason: OneTapNotShownReason;
|
|
10
|
-
};
|
|
11
|
-
declare global {
|
|
12
|
-
// The telemetry.js script will set a global function called GetTelemetryID on the window
|
|
13
|
-
// object. This interface is allows us to call that function while pleasing the TypeScript
|
|
14
|
-
// compiler.
|
|
15
|
-
interface Window {
|
|
16
|
-
GetTelemetryID: (publicToken: string, submitURL: string) => Promise<string>;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
type B2BGoogleOneTapDiscoveryOAuthOptions = {
|
|
20
|
-
/**
|
|
21
|
-
* The URL that Stytch redirects to after the Google One Tap discovery flow is completed.
|
|
22
|
-
* This should be a URL that verifies the request by querying Stytch's /oauth/discovery/authenticate endpoint.
|
|
23
|
-
* If this value is not passed, the default discovery redirect URL that you set in your Dashboard is used.
|
|
24
|
-
* If you have not set a default discovery redirect URL, an error is returned.
|
|
25
|
-
*/
|
|
26
|
-
discovery_redirect_url?: string;
|
|
27
|
-
};
|
|
28
|
-
type B2BGoogleOneTapOAuthOptions = {
|
|
29
|
-
/**
|
|
30
|
-
* The ID of the organization that the end user is logging in to.
|
|
31
|
-
*/
|
|
32
|
-
organization_id: string;
|
|
33
|
-
/**
|
|
34
|
-
* The URL that Stytch redirects to after the Google One Tap flow is completed for a member who already exists.
|
|
35
|
-
* This should be a URL that verifies the request by querying Stytch's /oauth/authenticate endpoint.
|
|
36
|
-
* If this value is not passed, the default login redirect URL that you set in your Dashboard is used.
|
|
37
|
-
* If you have not set a default login redirect URL, an error is returned.
|
|
38
|
-
*/
|
|
39
|
-
login_redirect_url?: string;
|
|
40
|
-
/**
|
|
41
|
-
* The URL that Stytch redirects to after the Google One Tap flow is completed for a member who does not yet exist.
|
|
42
|
-
* This should be a URL that verifies the request by querying Stytch's /oauth/authenticate endpoint.
|
|
43
|
-
* If this value is not passed, the default signup redirect URL that you set in your Dashboard is used.
|
|
44
|
-
* If you have not set a default signup redirect URL, an error is returned.
|
|
45
|
-
*/
|
|
46
|
-
signup_redirect_url?: string;
|
|
47
|
-
};
|
|
48
|
-
interface IB2BGoogleOneTapOAuthProvider {
|
|
49
|
-
discovery: {
|
|
50
|
-
/**
|
|
51
|
-
* Start a discovery OAuth flow by showing the Google one tap prompt in the top right corner of the user's browser.
|
|
52
|
-
* You can configure this to be started by a user action (i.e Button click) or on load/render.
|
|
53
|
-
* @example
|
|
54
|
-
* const showGoogleOneTap = useCallback(()=> {
|
|
55
|
-
* stytch.oauth.googleOneTap.discovery.start({
|
|
56
|
-
* discovery_redirect_url: 'https://example.com/oauth/callback',
|
|
57
|
-
* })
|
|
58
|
-
* }, [stytch]);
|
|
59
|
-
* return (
|
|
60
|
-
* <Button onClick={showGoogleOneTap}> Show Google one tap </Button>
|
|
61
|
-
* );
|
|
62
|
-
*
|
|
63
|
-
* @param options - A {@link B2BGoogleOneTapDiscoveryOAuthOptions} object
|
|
64
|
-
*
|
|
65
|
-
* @returns A {@link OneTapRenderResult} object. The result object includes if the one-tap prompt
|
|
66
|
-
* was rendered, and a reason if it couldn't be rendered.
|
|
67
|
-
*
|
|
68
|
-
* @throws An Error if the one tap client cannot be created.
|
|
69
|
-
*/
|
|
70
|
-
start(options?: B2BGoogleOneTapDiscoveryOAuthOptions): Promise<OneTapRenderResult>;
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* Start an OAuth flow by showing the Google one tap prompt in the top right corner of the user's browser.
|
|
74
|
-
* You can configure this to be started by a user action (i.e Button click) or on load/render.
|
|
75
|
-
* @example
|
|
76
|
-
* const showGoogleOneTap = useCallback(()=> {
|
|
77
|
-
* stytch.oauth.googleOneTap.start({
|
|
78
|
-
* organization_id: 'organization-test-123',
|
|
79
|
-
* })
|
|
80
|
-
* }, [stytch]);
|
|
81
|
-
* return (
|
|
82
|
-
* <Button onClick={showGoogleOneTap}> Show Google one tap </Button>
|
|
83
|
-
* );
|
|
84
|
-
*
|
|
85
|
-
* @param options - A {@link B2BGoogleOneTapOAuthOptions} object
|
|
86
|
-
*
|
|
87
|
-
* @returns A {@link OneTapRenderResult} object. The result object includes if the one-tap prompt
|
|
88
|
-
* was rendered, and a reason if it couldn't be rendered.
|
|
89
|
-
*
|
|
90
|
-
* @throws An Error if the one tap client cannot be created.
|
|
91
|
-
*/
|
|
92
|
-
start(options?: B2BGoogleOneTapOAuthOptions): Promise<OneTapRenderResult>;
|
|
93
|
-
}
|
|
94
|
-
interface IWebB2BOAuthClient extends IHeadlessB2BOAuthClient {
|
|
95
|
-
googleOneTap: IB2BGoogleOneTapOAuthProvider;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* A headless client used for invoking Stytch's B2B APIs.
|
|
99
|
-
* The Stytch Headless Client can be used as a drop-in solution for authentication and session management.
|
|
100
|
-
* Full documentation can be found {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online}.
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
* const stytch = new StytchB2BHeadlessClient('public-token-<find yours in the stytch dashboard>');
|
|
104
|
-
* stytch.magicLinks.email.loginOrCreate({
|
|
105
|
-
* email: 'sandbox@stytch.com',
|
|
106
|
-
* organization_id: 'organization-test-123',
|
|
107
|
-
* });
|
|
108
|
-
*/
|
|
109
|
-
declare class StytchB2BHeadlessClient {
|
|
110
|
-
private readonly _subscriptionService;
|
|
111
|
-
private readonly _sessionManager;
|
|
112
|
-
private readonly _networkClient;
|
|
113
|
-
// The _apiNetworkClient uses the API instead of web-backend as the SDK backend URL. We choose between the test and
|
|
114
|
-
// live URL based on the public token.
|
|
115
|
-
private readonly _apiNetworkClient;
|
|
116
|
-
private readonly _dataLayer;
|
|
117
|
-
private readonly _stateChangeClient;
|
|
118
|
-
// External API Clients
|
|
119
|
-
magicLinks: IHeadlessB2BMagicLinksClient;
|
|
120
|
-
session: IHeadlessB2BSessionClient;
|
|
121
|
-
/** @deprecated Please use client.self instead. This will be removed in a future release. */
|
|
122
|
-
member: IHeadlessB2BMemberClient;
|
|
123
|
-
self: IHeadlessB2BSelfClient;
|
|
124
|
-
organization: IHeadlessB2BOrganizationClient;
|
|
125
|
-
oauth: IWebB2BOAuthClient;
|
|
126
|
-
sso: IHeadlessB2BSSOClient;
|
|
127
|
-
discovery: IHeadlessB2BDiscoveryClient;
|
|
128
|
-
passwords: IHeadlessB2BPasswordClient;
|
|
129
|
-
otps: IHeadlessB2BOTPsClient;
|
|
130
|
-
totp: IHeadlessB2BTOTPsClient;
|
|
131
|
-
recoveryCodes: IHeadlessB2BRecoveryCodesClient;
|
|
132
|
-
rbac: IHeadlessB2BRBACClient;
|
|
133
|
-
// External methods
|
|
134
|
-
/**
|
|
135
|
-
* Register a callback function to be invoked whenever certain state changes
|
|
136
|
-
* occur, like a member or session object being updated.
|
|
137
|
-
*
|
|
138
|
-
* This is an alternative to more specific methods like `self.onChange` and
|
|
139
|
-
* `session.onChange`. It can be helpful if you want to be notified of related
|
|
140
|
-
* changes to different parts of state at once.
|
|
141
|
-
*
|
|
142
|
-
* If you are only interested in specific state changes, consider using more
|
|
143
|
-
* specific methods like `self.onChange` and `session.onChange` instead.
|
|
144
|
-
*/
|
|
145
|
-
onStateChange: StateChangeRegisterFunction<B2BState>;
|
|
146
|
-
constructor(_PUBLIC_TOKEN: string, options?: StytchClientOptions);
|
|
147
|
-
}
|
|
148
|
-
export { StytchB2BHeadlessClient };
|
|
149
|
-
export * from '@stytch/core/public';
|
package/dist/index.esm.d.ts
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { StateChangeRegisterFunction } from "@stytch/core";
|
|
2
|
-
import { ConsumerState, IHeadlessCryptoWalletClient, IHeadlessMagicLinksClient, IHeadlessOTPsClient, IHeadlessPasswordClient, IHeadlessSessionClient, IHeadlessTOTPClient, IHeadlessUserClient, IHeadlessWebAuthnClient, StytchClientOptions, IHeadlessOAuthClient, Callbacks, StytchLoginConfig, StyleConfig } from "@stytch/core/public";
|
|
3
|
-
import { PromptMomentNotification } from "google-one-tap";
|
|
4
|
-
type OneTapNotShownReason = ReturnType<PromptMomentNotification["getNotDisplayedReason"]> | ReturnType<PromptMomentNotification["getSkippedReason"]>;
|
|
5
|
-
type OneTapRenderResult = {
|
|
6
|
-
success: true;
|
|
7
|
-
} | {
|
|
8
|
-
success: false;
|
|
9
|
-
reason: OneTapNotShownReason;
|
|
10
|
-
};
|
|
11
|
-
type GoogleOneTapOAuthOptions = {
|
|
12
|
-
/**
|
|
13
|
-
* The URL that Stytch redirects to after the OAuth flow is completed for a user that already exists.
|
|
14
|
-
* This URL should be an endpoint in the backend server that verifies the request by querying Stytch's /oauth/authenticate endpoint and finishes the login.
|
|
15
|
-
* The URL should be configured as a Login URL in the Stytch Dashboard's Redirect URL page.
|
|
16
|
-
* If the field is not specified, the default in the Dashboard is used.
|
|
17
|
-
*/
|
|
18
|
-
login_redirect_url?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The URL that Stytch redirects to after the OAuth flow is completed for a user that does not yet exist.
|
|
21
|
-
* This URL should be an endpoint in the backend server that verifies the request by querying Stytch's /oauth/authenticate endpoint and finishes the login.
|
|
22
|
-
* The URL should be configured as a Sign Up URL in the Stytch Dashboard's Redirect URL page.
|
|
23
|
-
* If the field is not specified, the default in the Dashboard is used.
|
|
24
|
-
*/
|
|
25
|
-
signup_redirect_url?: string;
|
|
26
|
-
/**
|
|
27
|
-
* An optional callback function that runs when a user explicitly cancels out of the one tap flow.
|
|
28
|
-
* This callback may not be invoked immediately or at all depending on the behavior of the browser and Google's SDK.
|
|
29
|
-
*/
|
|
30
|
-
onOneTapCancelled?: () => void;
|
|
31
|
-
};
|
|
32
|
-
interface IGoogleOneTapOAuthProvider {
|
|
33
|
-
/**
|
|
34
|
-
* Start an OAuth flow by showing the Google one tap prompt in the top right corner of the user's browser.
|
|
35
|
-
* You can configure this to be started by a user action (i.e Button click) or on load/render.
|
|
36
|
-
* @example
|
|
37
|
-
* const showGoogleOneTap = useCallback(()=> {
|
|
38
|
-
* stytch.oauth.googleOneTap.start({
|
|
39
|
-
* login_redirect_url: 'https://example.com/oauth/callback',
|
|
40
|
-
* signup_redirect_url: 'https://example.com/oauth/callback',
|
|
41
|
-
* })
|
|
42
|
-
* }, [stytch]);
|
|
43
|
-
* return (
|
|
44
|
-
* <Button onClick={showGoogleOneTap}> Show Google one tap </Button>
|
|
45
|
-
* );
|
|
46
|
-
*
|
|
47
|
-
* @param options - An {@link GoogleOneTapOAuthOptions} object
|
|
48
|
-
*
|
|
49
|
-
* @returns A {@link OneTapRenderResult} object. The result object includes if the one-tap prompt
|
|
50
|
-
* was rendered, and a reason if it couldn't be rendered.
|
|
51
|
-
*
|
|
52
|
-
* @throws An Error if the one tap client cannot be created.
|
|
53
|
-
*/
|
|
54
|
-
start(options?: GoogleOneTapOAuthOptions): Promise<OneTapRenderResult>;
|
|
55
|
-
}
|
|
56
|
-
interface IWebOAuthClient extends IHeadlessOAuthClient {
|
|
57
|
-
googleOneTap: IGoogleOneTapOAuthProvider;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* A headless client used for invoking the Stytch API.
|
|
61
|
-
* The Stytch Headless Client can be used as a drop-in solution for authentication and session management.
|
|
62
|
-
* Full documentation can be found {@link https://stytch.com/docs/sdks/javascript-sdk online}.
|
|
63
|
-
* @example
|
|
64
|
-
* const stytch = new StytchHeadlessClient('public-token-<find yours in the stytch dashboard>');
|
|
65
|
-
* stytch.magicLinks.email.loginOrCreate('sandbox@stytch.com', {
|
|
66
|
-
* login_magic_link_url: 'https://example.com/authenticate',
|
|
67
|
-
* login_expiration_minutes: 60,
|
|
68
|
-
* signup_magic_link_url: 'https://example.com/authenticate',
|
|
69
|
-
* signup_expiration_minutes: 60,
|
|
70
|
-
* });
|
|
71
|
-
*/
|
|
72
|
-
declare class StytchHeadlessClient {
|
|
73
|
-
private readonly _subscriptionService;
|
|
74
|
-
private readonly _sessionManager;
|
|
75
|
-
private readonly _networkClient;
|
|
76
|
-
private readonly _dataLayer;
|
|
77
|
-
private readonly _stateChangeClient;
|
|
78
|
-
// External API Clients
|
|
79
|
-
user: IHeadlessUserClient;
|
|
80
|
-
magicLinks: IHeadlessMagicLinksClient;
|
|
81
|
-
session: IHeadlessSessionClient;
|
|
82
|
-
otps: IHeadlessOTPsClient;
|
|
83
|
-
oauth: IWebOAuthClient;
|
|
84
|
-
cryptoWallets: IHeadlessCryptoWalletClient;
|
|
85
|
-
totps: IHeadlessTOTPClient;
|
|
86
|
-
webauthn: IHeadlessWebAuthnClient;
|
|
87
|
-
passwords: IHeadlessPasswordClient;
|
|
88
|
-
// External methods
|
|
89
|
-
/**
|
|
90
|
-
* Register a callback function to be invoked whenever certain state changes
|
|
91
|
-
* occur, like a user or session object being updated.
|
|
92
|
-
*
|
|
93
|
-
* This is an alternative to more specific methods like `user.onChange` and
|
|
94
|
-
* `session.onChange`. It can be helpful if you want to be notified of related
|
|
95
|
-
* changes to different parts of state at once.
|
|
96
|
-
*
|
|
97
|
-
* If you are only interested in specific state changes, consider using more
|
|
98
|
-
* specific methods like `user.onChange` and `session.onChange` instead.
|
|
99
|
-
*/
|
|
100
|
-
onStateChange: StateChangeRegisterFunction<ConsumerState>;
|
|
101
|
-
constructor(_PUBLIC_TOKEN: string, options?: StytchClientOptions);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* A client used for invoking the Stytch API an.
|
|
105
|
-
* The Stytch UI Client can be used as a drop-in solution for authentication and session management.
|
|
106
|
-
* The Stytch UI client also can be used to render various UI elements for managing users.
|
|
107
|
-
* Full documentation can be found {@link https://stytch.com/docs/sdks/javascript-sdk online.}
|
|
108
|
-
* @example
|
|
109
|
-
* const stytch = new StytchUIClient('public-token-<find yours in the stytch dashboard>');
|
|
110
|
-
* stytch.magicLinks.email.loginOrCreate('sandbox@stytch.com', {
|
|
111
|
-
* login_magic_link_url: 'https://example.com/authenticate',
|
|
112
|
-
* login_expiration_minutes: 60,
|
|
113
|
-
* signup_magic_link_url: 'https://example.com/authenticate',
|
|
114
|
-
* signup_expiration_minutes: 60,
|
|
115
|
-
* });
|
|
116
|
-
*/
|
|
117
|
-
declare class StytchUIClient extends StytchHeadlessClient {
|
|
118
|
-
constructor(...args: ConstructorParameters<typeof StytchHeadlessClient>);
|
|
119
|
-
/**
|
|
120
|
-
* Mounts a login screen inside the element provided.
|
|
121
|
-
* If a login screen has already been rendered inside the element,
|
|
122
|
-
* it will be updated to use the new config, style, and callback options passed in.
|
|
123
|
-
* @example
|
|
124
|
-
* stytchClient.mountLogin({
|
|
125
|
-
* elementId: '#login-container',
|
|
126
|
-
* config: {...}
|
|
127
|
-
* });
|
|
128
|
-
*
|
|
129
|
-
* @param elementId - A string containing the id of the element that should contain the login screen.
|
|
130
|
-
* @param config - A {@link StytchLoginConfig} object containing the products that should be registered
|
|
131
|
-
* @param styles - A {@link StyleConfig} object containing custom styling info
|
|
132
|
-
* @param callbacks - Optional {@link Callbacks} triggered by various events in the Stytch SDK.
|
|
133
|
-
* @throws An error when the element specified by elementId cannot be found.
|
|
134
|
-
*/
|
|
135
|
-
mountLogin({ elementId, config, styles, callbacks }: {
|
|
136
|
-
elementId: string;
|
|
137
|
-
config: StytchLoginConfig;
|
|
138
|
-
styles?: StyleConfig;
|
|
139
|
-
callbacks?: Callbacks;
|
|
140
|
-
}): void;
|
|
141
|
-
/**
|
|
142
|
-
* Mounts a reset password screen inside the element provided.
|
|
143
|
-
* If a reset password screen has already been rendered inside the element,
|
|
144
|
-
* it will be updated to use the new config, style, and callback options passed in.
|
|
145
|
-
* @example
|
|
146
|
-
* stytchClient.mountResetPassword({
|
|
147
|
-
* elementId: '#login-container',
|
|
148
|
-
* config: {...}
|
|
149
|
-
* });
|
|
150
|
-
*
|
|
151
|
-
* @param elementId - A string containing the id of the element that should contain the login screen.
|
|
152
|
-
* @param config - A {@link StytchLoginConfig} object containing the products that should be registered
|
|
153
|
-
* @param styles - A {@link StyleConfig} object containing custom styling info
|
|
154
|
-
* @param callbacks - Optional {@link Callbacks} triggered by various events in the Stytch SDK.
|
|
155
|
-
* @throws An error when the element specified by elementId cannot be found.
|
|
156
|
-
*/
|
|
157
|
-
mountResetPassword({ elementId, config, styles, callbacks, passwordResetToken }: {
|
|
158
|
-
elementId: string;
|
|
159
|
-
config: StytchLoginConfig;
|
|
160
|
-
styles?: StyleConfig;
|
|
161
|
-
callbacks?: Callbacks;
|
|
162
|
-
passwordResetToken: string;
|
|
163
|
-
}): void;
|
|
164
|
-
/**
|
|
165
|
-
* Mounts a Passkey registration screen inside the element provided.
|
|
166
|
-
* If a passkey registration screen has already been rendered inside the element,
|
|
167
|
-
* it will be updated to use the new config, style, and callback options passed in.
|
|
168
|
-
* @example
|
|
169
|
-
* stytchClient.mountPasskeyRegistration({
|
|
170
|
-
* elementId: '#login-container',
|
|
171
|
-
* config: {...}
|
|
172
|
-
* });
|
|
173
|
-
*
|
|
174
|
-
* @param elementId - A string containing the id of the element that should contain the login screen.
|
|
175
|
-
* @param config - A {@link StytchLoginConfig} object containing the products that should be registered
|
|
176
|
-
* @param styles - A {@link StyleConfig} object containing custom styling info
|
|
177
|
-
* @param callbacks - Optional {@link Callbacks} triggered by various events in the Stytch SDK.
|
|
178
|
-
* @throws An error when the element specified by elementId cannot be found.
|
|
179
|
-
*/
|
|
180
|
-
mountPasskeyRegistration({ elementId, config, styles, callbacks }: {
|
|
181
|
-
elementId: string;
|
|
182
|
-
config: StytchLoginConfig;
|
|
183
|
-
styles?: StyleConfig;
|
|
184
|
-
callbacks?: Callbacks;
|
|
185
|
-
}): void;
|
|
186
|
-
}
|
|
187
|
-
export { StytchUIClient };
|
|
188
|
-
export * from '@stytch/core/public';
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { StateChangeRegisterFunction } from "@stytch/core";
|
|
2
|
-
import { ConsumerState, IHeadlessCryptoWalletClient, IHeadlessMagicLinksClient, IHeadlessOTPsClient, IHeadlessPasswordClient, IHeadlessSessionClient, IHeadlessTOTPClient, IHeadlessUserClient, IHeadlessWebAuthnClient, StytchClientOptions, IHeadlessOAuthClient } from "@stytch/core/public";
|
|
3
|
-
import { PromptMomentNotification } from "google-one-tap";
|
|
4
|
-
type OneTapNotShownReason = ReturnType<PromptMomentNotification["getNotDisplayedReason"]> | ReturnType<PromptMomentNotification["getSkippedReason"]>;
|
|
5
|
-
type OneTapRenderResult = {
|
|
6
|
-
success: true;
|
|
7
|
-
} | {
|
|
8
|
-
success: false;
|
|
9
|
-
reason: OneTapNotShownReason;
|
|
10
|
-
};
|
|
11
|
-
type GoogleOneTapOAuthOptions = {
|
|
12
|
-
/**
|
|
13
|
-
* The URL that Stytch redirects to after the OAuth flow is completed for a user that already exists.
|
|
14
|
-
* This URL should be an endpoint in the backend server that verifies the request by querying Stytch's /oauth/authenticate endpoint and finishes the login.
|
|
15
|
-
* The URL should be configured as a Login URL in the Stytch Dashboard's Redirect URL page.
|
|
16
|
-
* If the field is not specified, the default in the Dashboard is used.
|
|
17
|
-
*/
|
|
18
|
-
login_redirect_url?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The URL that Stytch redirects to after the OAuth flow is completed for a user that does not yet exist.
|
|
21
|
-
* This URL should be an endpoint in the backend server that verifies the request by querying Stytch's /oauth/authenticate endpoint and finishes the login.
|
|
22
|
-
* The URL should be configured as a Sign Up URL in the Stytch Dashboard's Redirect URL page.
|
|
23
|
-
* If the field is not specified, the default in the Dashboard is used.
|
|
24
|
-
*/
|
|
25
|
-
signup_redirect_url?: string;
|
|
26
|
-
/**
|
|
27
|
-
* An optional callback function that runs when a user explicitly cancels out of the one tap flow.
|
|
28
|
-
* This callback may not be invoked immediately or at all depending on the behavior of the browser and Google's SDK.
|
|
29
|
-
*/
|
|
30
|
-
onOneTapCancelled?: () => void;
|
|
31
|
-
};
|
|
32
|
-
interface IGoogleOneTapOAuthProvider {
|
|
33
|
-
/**
|
|
34
|
-
* Start an OAuth flow by showing the Google one tap prompt in the top right corner of the user's browser.
|
|
35
|
-
* You can configure this to be started by a user action (i.e Button click) or on load/render.
|
|
36
|
-
* @example
|
|
37
|
-
* const showGoogleOneTap = useCallback(()=> {
|
|
38
|
-
* stytch.oauth.googleOneTap.start({
|
|
39
|
-
* login_redirect_url: 'https://example.com/oauth/callback',
|
|
40
|
-
* signup_redirect_url: 'https://example.com/oauth/callback',
|
|
41
|
-
* })
|
|
42
|
-
* }, [stytch]);
|
|
43
|
-
* return (
|
|
44
|
-
* <Button onClick={showGoogleOneTap}> Show Google one tap </Button>
|
|
45
|
-
* );
|
|
46
|
-
*
|
|
47
|
-
* @param options - An {@link GoogleOneTapOAuthOptions} object
|
|
48
|
-
*
|
|
49
|
-
* @returns A {@link OneTapRenderResult} object. The result object includes if the one-tap prompt
|
|
50
|
-
* was rendered, and a reason if it couldn't be rendered.
|
|
51
|
-
*
|
|
52
|
-
* @throws An Error if the one tap client cannot be created.
|
|
53
|
-
*/
|
|
54
|
-
start(options?: GoogleOneTapOAuthOptions): Promise<OneTapRenderResult>;
|
|
55
|
-
}
|
|
56
|
-
interface IWebOAuthClient extends IHeadlessOAuthClient {
|
|
57
|
-
googleOneTap: IGoogleOneTapOAuthProvider;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* A headless client used for invoking the Stytch API.
|
|
61
|
-
* The Stytch Headless Client can be used as a drop-in solution for authentication and session management.
|
|
62
|
-
* Full documentation can be found {@link https://stytch.com/docs/sdks/javascript-sdk online}.
|
|
63
|
-
* @example
|
|
64
|
-
* const stytch = new StytchHeadlessClient('public-token-<find yours in the stytch dashboard>');
|
|
65
|
-
* stytch.magicLinks.email.loginOrCreate('sandbox@stytch.com', {
|
|
66
|
-
* login_magic_link_url: 'https://example.com/authenticate',
|
|
67
|
-
* login_expiration_minutes: 60,
|
|
68
|
-
* signup_magic_link_url: 'https://example.com/authenticate',
|
|
69
|
-
* signup_expiration_minutes: 60,
|
|
70
|
-
* });
|
|
71
|
-
*/
|
|
72
|
-
declare class StytchHeadlessClient {
|
|
73
|
-
private readonly _subscriptionService;
|
|
74
|
-
private readonly _sessionManager;
|
|
75
|
-
private readonly _networkClient;
|
|
76
|
-
private readonly _dataLayer;
|
|
77
|
-
private readonly _stateChangeClient;
|
|
78
|
-
// External API Clients
|
|
79
|
-
user: IHeadlessUserClient;
|
|
80
|
-
magicLinks: IHeadlessMagicLinksClient;
|
|
81
|
-
session: IHeadlessSessionClient;
|
|
82
|
-
otps: IHeadlessOTPsClient;
|
|
83
|
-
oauth: IWebOAuthClient;
|
|
84
|
-
cryptoWallets: IHeadlessCryptoWalletClient;
|
|
85
|
-
totps: IHeadlessTOTPClient;
|
|
86
|
-
webauthn: IHeadlessWebAuthnClient;
|
|
87
|
-
passwords: IHeadlessPasswordClient;
|
|
88
|
-
// External methods
|
|
89
|
-
/**
|
|
90
|
-
* Register a callback function to be invoked whenever certain state changes
|
|
91
|
-
* occur, like a user or session object being updated.
|
|
92
|
-
*
|
|
93
|
-
* This is an alternative to more specific methods like `user.onChange` and
|
|
94
|
-
* `session.onChange`. It can be helpful if you want to be notified of related
|
|
95
|
-
* changes to different parts of state at once.
|
|
96
|
-
*
|
|
97
|
-
* If you are only interested in specific state changes, consider using more
|
|
98
|
-
* specific methods like `user.onChange` and `session.onChange` instead.
|
|
99
|
-
*/
|
|
100
|
-
onStateChange: StateChangeRegisterFunction<ConsumerState>;
|
|
101
|
-
constructor(_PUBLIC_TOKEN: string, options?: StytchClientOptions);
|
|
102
|
-
}
|
|
103
|
-
export { StytchHeadlessClient };
|
|
104
|
-
export * from '@stytch/core/public';
|