CDP Frontend SDK
    Preparing search index...
    • A button that signs the user in or out.

      This component will render the SignInModal component when the user is signed out, and a SignOutButton when the user is signed in. If the SDK is initializing (i.e. the initial user state is pending), the component will render a loading skeleton.

      Parameters

      • props: AuthButtonProps & HTMLAttributes<HTMLDivElement>

        The props for the component.

        The props for the AuthButton component.

        • OptionalcloseOnSuccessDelay?: null | number

          The delay in milliseconds before the sign in modal is closed and the sign out button is shown after the sign in is successful. If null, the sign in modal will not be closed automatically. If 0, the sign in modal will be closed immediately.

        • OptionalonSignInSuccess?: () => void

          A function to call when the sign in is successful.

        • OptionalonSignInSuccessTransitionEnd?: () => void

          A function to call after the sign in success, when the dialog close transition ends.

        • OptionalonSignOutSuccess?: () => void

          A function to call when the sign out is successful.

        • closeOnSuccessDelay

          The delay in milliseconds before the sign in modal is closed and the sign out button is shown after the sign in is successful.

        • onSignInSuccess

          The function to call when the sign in is successful.

        • onSignInSuccessTransitionEnd

          The function to call when the sign in success transition ends.

      Returns Element

      The rendered component.

      function App() {
      // Render the AuthButton component
      return (
      <CDPReactProvider config={cdpConfig} app={appConfig} theme={themeOverrides}>
      <AuthButton />
      </CDPReactProvider>
      );
      }