javascript

Official Javascript repository for Clerk authentication

MIT License

Downloads
6.1M
Stars
1.1K
Committers
167
javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Minor Changes

  • Add support for GoogleOneTap. New APIs listed: (#3392) by @panteliselef

    React component

    • <GoogleOneTap/>

    Customize the UX of the prompt

    <GoogleOneTap
      cancelOnTapOutside={false}
      itpSupport={false}
      fedCmSupport={false}
    />
    

    Use the component from with Vanilla JS

    • Clerk.openGoogleOneTap(props: GoogleOneTapProps)
    • 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 to perform the correct redirections.

    google.accounts.id.initialize({
      callback: async response => {
        const signInOrUp = await Clerk.authenticateWithGoogleOneTap({ token: response.credential });
        await Clerk.handleGoogleOneTapCallback(signInOrUp, {
          signInForceRedirectUrl: 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

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Minor Changes

  • Add support for GoogleOneTap. New APIs listed: (#3392) by @panteliselef

    React component

    • <GoogleOneTap/>

    Customize the UX of the prompt

    <GoogleOneTap
      cancelOnTapOutside={false}
      itpSupport={false}
      fedCmSupport={false}
    />
    

    Use the component from with Vanilla JS

    • Clerk.openGoogleOneTap(props: GoogleOneTapProps)
    • 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 to perform the correct redirections.

    google.accounts.id.initialize({
      callback: async response => {
        const signInOrUp = await Clerk.authenticateWithGoogleOneTap({ token: response.credential });
        await Clerk.handleGoogleOneTapCallback(signInOrUp, {
          signInForceRedirectUrl: 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

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Minor Changes

  • Add support for GoogleOneTap. New APIs listed: (#3392) by @panteliselef

    React component

    • <GoogleOneTap/>

    Customize the UX of the prompt

    <GoogleOneTap
      cancelOnTapOutside={false}
      itpSupport={false}
      fedCmSupport={false}
    />
    

    Use the component from with Vanilla JS

    • Clerk.openGoogleOneTap(props: GoogleOneTapProps)
    • 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 to perform the correct redirections.

    google.accounts.id.initialize({
      callback: async response => {
        const signInOrUp = await Clerk.authenticateWithGoogleOneTap({ token: response.credential });
        await Clerk.handleGoogleOneTapCallback(signInOrUp, {
          signInForceRedirectUrl: 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

  • A bug was fixed to not override the existing sign-up state on the OAuth callback. (#3401) by @LauraBeatris

    When continuing a sign-up flow with social connections, @clerk/clerk-js was creating a new SignUpResource object, instead of patching the existing one.

    This was affecting Web3 sign-up flows, since the wallet ID was being overridden on the browser redirect.

  • Updated dependencies [d6a9b3f5d, 456b06849]:

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Minor Changes

  • Consume and expose the 'saml_accounts' property of the user resource (#3405) by @chanioxaris

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Minor Changes

  • Added the following types (#3409) by @panteliselef

    interface Clerk {
      ...
      openGoogleOneTap: (props?: GoogleOneTapProps) => void;
      closeGoogleOneTap: () => void;
      authenticateWithGoogleOneTap: (params: AuthenticateWithGoogleOneTapParams) => Promise<SignInResource | SignUpResource>;
      handleGoogleOneTapCallback: (
        signInOrUp: SignInResource | SignUpResource,
        params: HandleOAuthCallbackParams,
        customNavigate?: (to: string) => Promise<unknown>,
      ) => Promise<unknown>;
      ...
    }
    
    type GoogleOneTapStrategy = 'google_one_tap'
    
javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Minor Changes

  • Add support for GoogleOneTap (#3409) by @panteliselef

    React component

    • <GoogleOneTap/>

    Customize the UX of the prompt

    <GoogleOneTap
      cancelOnTapOutside={false}
      itpSupport={false}
      fedCmSupport={false}
    />
    

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Minor Changes

  • Add support for GoogleOneTap (#3409) by @panteliselef

    React component

    • <GoogleOneTap/>

    Customize the UX of the prompt

    <GoogleOneTap
      cancelOnTapOutside={false}
      itpSupport={false}
      fedCmSupport={false}
    />
    

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Patch Changes

javascript - [email protected]

Published by clerk-cookie 5 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 5 months ago

Patch Changes