github clerk/javascript @clerk/nextjs@6.1.0

latest releases: @clerk/types@4.92.0, @clerk/clerk-js@5.99.0, @clerk/fastify@2.4.37...
12 months ago

Minor Changes

  • Bug fix: For next>=14 applications resolve __unstable__onBeforeSetActive once invalidateCacheAction resolves. (#4362) by @panteliselef

  • Introduce a new experimental hook called useReverification that makes it easy to handle reverification errors. (#4362) by @panteliselef

    It returns a high order function (HOF) and allows developers to wrap any function that triggers a fetch request which might fail due to a user's session verification status.
    When such error is returned, the recommended UX is to offer a way to the user to recover by re-verifying their credentials.
    This helper will automatically handle this flow in the developer's behalf, by displaying a modal the end-user can interact with.
    Upon completion, the original request that previously failed, will be retried (only once).

    Example with clerk-js methods.

    import { __experimental_useReverification as useReverification } from "@clerk/nextjs";
    
    function DeleteAccount() {
      const { user } = useUser();
      const [deleteUserAccount] = useReverification(() => {
        if (!user) return;
        return user.delete();
      });
    
      return (
        <>
          <button
            onClick={async () => {
              await deleteUserAccount();
            }}
          >
            Delete account
          </button>
        </>
      );
    }
  • Replace next/headers with ezheaders (#4392) by @panteliselef

Patch Changes

Don't miss a new javascript release

NewReleases is sending notifications on new releases.