Skip to content
Compare
Choose a tag to compare
@clerk-cookie clerk-cookie released this 21 May 16:51
· 1253 commits to main since this release
5272a9e

Minor Changes

  • Use the Google One Tap component from with Vanilla JS (#3409) by @panteliselef

    • Clerk.openGoogleOneTap({ cancelOnTapOutside: false, fedCmSupport: false, itpSupport: false })
    • Clerk.closeGoogleOneTap()

    Low level APIs for custom flows

    • await Clerk.authenticateWithGoogleOneTap({ token: 'xxxx'})
    • await Clerk.handleGoogleOneTapCallback()

    We recommend using this two methods together in order and let Clerk perform the correct redirections.

    google.accounts.id.initialize({
      callback: async response => {
        const signInOrUp = await Clerk.authenticateWithGoogleOneTap({ token: response.credential });
        await Clerk.handleGoogleOneTapCallback(signInOrUp, {
          afterSignInUrl: window.location.href,
        });
      },
    });

    In case you want to handle the redirection and session management yourself you can do so like this

    google.accounts.id.initialize({
      callback: async response => {
        const signInOrUp = await Clerk.authenticateWithGoogleOneTap({ token: response.credential });
        if (signInOrUp.status === 'complete') {
          await Clerk.setActive({
            session: signInOrUp.createdSessionId,
          });
        }
      },
    });

Patch Changes