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 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Minor Changes

  • Remove MemberRole TypeMemberRole would always include the old role keys admin, member, guest_member. (#2388) by @panteliselef

    If developers still depend on them after the introduction of custom roles, the can provide them as their custom types for authorization.

    // clerk.d.ts
    export {};
    
    interface ClerkAuthorization {
      permission: '';
      role: 'admin' | 'basic_member' | 'guest_member';
    }
    
  • Update @clerk/clerk-js and @clerk/clerk-react to support the following examples: (#2412) by @dimkl

    Clerk.signOut({ redirectUrl: '/' })
    
    <SignOutButton redirectUrl='/' />
    // uses Clerk.signOut({ redirectUrl: '/' })
    <UserButton afterSignOutUrl='/after' />
    // uses Clerk.signOut({ redirectUrl: '/after' })
    <ClerkProvider afterSignOutUrl='/after' />
    // uses Clerk.signOut({ redirectUrl: '/after' })
    
javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Major Changes

  • Path-based routing is now the default routing strategy if the path prop is filled. Additionally, if the path and routing props are not filled, an error will be thrown. (#2338) by @octoper

    
    // Without path or routing props, an error with be thrown
    <UserProfile />
    <CreateOrganization />
    <OrganizationProfile />
    <SignIn />
    <SignUp />
    
    // Alternative #1
    <UserProfile path="/whatever"/>
    <CreateOrganization path="/whatever"/>
    <OrganizationProfile path="/whatever"/>
    <SignIn path="/whatever"/>
    <SignUp path="/whatever"/>
    
    // Alternative #2
    <UserProfile routing="hash_or_virtual"/>
    <CreateOrganization routing="hash_or_virtual"/>
    <OrganizationProfile routing="hash_or_virtual"/>
    <SignIn routing="hash_or_virtual"/>
    <SignUp routing="hash_or_virtual"/>
    

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Major Changes

  • Path-based routing is now the default routing strategy if the path prop is filled. Additionally, if the path and routing props are not filled, an error will be thrown. (#2338) by @octoper

    
    // Without path or routing props, an error with be thrown
    <UserProfile />
    <CreateOrganization />
    <OrganizationProfile />
    <SignIn />
    <SignUp />
    
    // Alternative #1
    <UserProfile path="/whatever"/>
    <CreateOrganization path="/whatever"/>
    <OrganizationProfile path="/whatever"/>
    <SignIn path="/whatever"/>
    <SignUp path="/whatever"/>
    
    // Alternative #2
    <UserProfile routing="hash_or_virtual"/>
    <CreateOrganization routing="hash_or_virtual"/>
    <OrganizationProfile routing="hash_or_virtual"/>
    <SignIn routing="hash_or_virtual"/>
    <SignUp routing="hash_or_virtual"/>
    

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Major Changes

  • Path-based routing is now the default routing strategy if the path prop is filled. Additionally, if the path and routing props are not filled, an error will be thrown. (#2338) by @octoper

    
    // Without path or routing props, an error with be thrown
    <UserProfile />
    <CreateOrganization />
    <OrganizationProfile />
    <SignIn />
    <SignUp />
    
    // Alternative #1
    <UserProfile path="/whatever"/>
    <CreateOrganization path="/whatever"/>
    <OrganizationProfile path="/whatever"/>
    <SignIn path="/whatever"/>
    <SignUp path="/whatever"/>
    
    // Alternative #2
    <UserProfile routing="hash_or_virtual"/>
    <CreateOrganization routing="hash_or_virtual"/>
    <OrganizationProfile routing="hash_or_virtual"/>
    <SignIn routing="hash_or_virtual"/>
    <SignUp routing="hash_or_virtual"/>
    
  • Consolidate afterSignOutOneUrl & afterSignOutAllUrl to afterSignOutUrl and drop usage of Dashboard settings in ClerkJS components. The Dashboard settings should only apply to the Account Portal application. (#2414) by @dimkl

Minor Changes

  • Remove MemberRole TypeMemberRole would always include the old role keys admin, member, guest_member. (#2388) by @panteliselef

    If developers still depend on them after the introduction of custom roles, the can provide them as their custom types for authorization.

    // clerk.d.ts
    export {};
    
    interface ClerkAuthorization {
      permission: '';
      role: 'admin' | 'basic_member' | 'guest_member';
    }
    
  • Update @clerk/clerk-js and @clerk/clerk-react to support the following examples: (#2412) by @dimkl

    Clerk.signOut({ redirectUrl: '/' })
    
    <SignOutButton redirectUrl='/' />
    // uses Clerk.signOut({ redirectUrl: '/' })
    <UserButton afterSignOutUrl='/after' />
    // uses Clerk.signOut({ redirectUrl: '/after' })
    <ClerkProvider afterSignOutUrl='/after' />
    // uses Clerk.signOut({ redirectUrl: '/after' })
    

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - [email protected]

Published by clerk-cookie 10 months ago

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Major Changes

  • Path-based routing is now the default routing strategy if the path prop is filled. Additionally, if the path and routing props are not filled, an error will be thrown. (#2338) by @octoper

    
    // Without path or routing props, an error with be thrown
    <UserProfile />
    <CreateOrganization />
    <OrganizationProfile />
    <SignIn />
    <SignUp />
    
    // Alternative #1
    <UserProfile path="/whatever"/>
    <CreateOrganization path="/whatever"/>
    <OrganizationProfile path="/whatever"/>
    <SignIn path="/whatever"/>
    <SignUp path="/whatever"/>
    
    // Alternative #2
    <UserProfile routing="hash_or_virtual"/>
    <CreateOrganization routing="hash_or_virtual"/>
    <OrganizationProfile routing="hash_or_virtual"/>
    <SignIn routing="hash_or_virtual"/>
    <SignUp routing="hash_or_virtual"/>
    
  • Make the user name on clickable, i.e. part of the button's trigger. (#2411) by @marcelscruz

    This change inverts the positions of cl-userButtonTrigger and cl-userButtonBox, the latter now being a child of the former.

  • Consolidate afterSignOutOneUrl & afterSignOutAllUrl to afterSignOutUrl and drop usage of Dashboard settings in ClerkJS components. The Dashboard settings should only apply to the Account Portal application. (#2414) by @dimkl

Minor Changes

  • Remove MemberRole TypeMemberRole would always include the old role keys admin, member, guest_member. (#2388) by @panteliselef

    If developers still depend on them after the introduction of custom roles, the can provide them as their custom types for authorization.

    // clerk.d.ts
    export {};
    
    interface ClerkAuthorization {
      permission: '';
      role: 'admin' | 'basic_member' | 'guest_member';
    }
    
  • Update @clerk/clerk-js and @clerk/clerk-react to support the following examples: (#2412) by @dimkl

    Clerk.signOut({ redirectUrl: '/' })
    
    <SignOutButton redirectUrl='/' />
    // uses Clerk.signOut({ redirectUrl: '/' })
    <UserButton afterSignOutUrl='/after' />
    // uses Clerk.signOut({ redirectUrl: '/after' })
    <ClerkProvider afterSignOutUrl='/after' />
    // uses Clerk.signOut({ redirectUrl: '/after' })
    

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Minor Changes

  • Add createOrganizationEnabled param in @clerk/backend method User.updateUser() (#2415) by @dimkl

    Example:

        import { createClerkClient }  from '@clerk/backend';
    
        const clerkClient = createClerkClient({...});
        await clerkClient.users.updateUser('user_...', { createOrganizationEnabled: true })
    

Patch Changes

  • OrganizationMembershipRole should respect authorization types provided by the developer if those exist. (#2408) by @panteliselef

  • Fixed an issue where errors returned from backend api requests are not converted to camelCase. (#2423) by @Nikpolik

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Major Changes

    • Remove BuildUrlWithAuthParams type (#2367) by @tmilewski

    • AuthConfigResource no longer has a urlBasedSessionSyncing property

    • buildUrlWithAuth no longer accepts an options argument of BuildUrlWithAuthParams.

  • Remove hashing and third-party cookie functionality related to development instance session syncing in favor of URL-based session syncing with query parameters. (#2367) by @tmilewski

  • Change return values of signJwt, hasValidSignature, decodeJwt, verifyJwt (#2377) by @dimkl

    to return { data, error }. Example of keeping the same behavior using those utilities:

    import { signJwt, hasValidSignature, decodeJwt, verifyJwt } from '@clerk/backend/jwt';
    
    const { data, error } = await signJwt(...)
    if (error) throw error;
    
    const { data, error } = await hasValidSignature(...)
    if (error) throw error;
    
    const { data, error } = decodeJwt(...)
    if (error) throw error;
    
    const { data, error } = await verifyJwt(...)
    if (error) throw error;
    

Minor Changes

  • Introduce new ResultWithError type in @clerk/types (#2377) by @dimkl
javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Major Changes

  • Replace the signOutCallback prop on the <SignOutButton /> with redirectUrl. This aligns the API surface with other UI components provided by @clerk/clerk-react. (#2348) by @LekoArts

    If you previously used the signOutCallback prop to navigate to another page, you can migrate as shown below.

    Before:

    import { SignOutButton } from '@clerk/clerk-react';
    
    export const Signout = () => {
      return (
        <SignOutButton
          signOutCallback={() => {
            window.location.href = '/your-path';
          }}
        >
          <button>Sign Out</button>
        </SignOutButton>
      );
    };
    

    After:

    import { SignOutButton } from '@clerk/clerk-react';
    
    export const Signout = () => {
      return (
        <SignOutButton redirectUrl='/your-path'>
          <button>Sign Out</button>
        </SignOutButton>
      );
    };
    
  • Remove hashing and third-party cookie functionality related to development instance session syncing in favor of URL-based session syncing with query parameters. (#2367) by @tmilewski

    • buildUrlWithAuth no longer accepts an options argument. (#2367) by @tmilewski

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Major Changes

  • Remove hashing and third-party cookie functionality related to development instance session syncing in favor of URL-based session syncing with query parameters. (#2367) by @tmilewski

  • Change return values of signJwt, hasValidSignature, decodeJwt, verifyJwt (#2377) by @dimkl

    to return { data, error }. Example of keeping the same behavior using those utilities:

    import { signJwt, hasValidSignature, decodeJwt, verifyJwt } from '@clerk/backend/jwt';
    
    const { data, error } = await signJwt(...)
    if (error) throw error;
    
    const { data, error } = await hasValidSignature(...)
    if (error) throw error;
    
    const { data, error } = decodeJwt(...)
    if (error) throw error;
    
    const { data, error } = await verifyJwt(...)
    if (error) throw error;
    
  • Changes in exports of @clerk/backend: (#2363) by @dimkl

    • Expose the following helpers and enums from @clerk/backend/internal:
      import {
        AuthStatus,
        buildRequestUrl,
        constants,
        createAuthenticateRequest,
        createIsomorphicRequest,
        debugRequestState,
        makeAuthObjectSerializable,
        prunePrivateMetadata,
        redirect,
        sanitizeAuthObject,
        signedInAuthObject,
        signedOutAuthObject,
      } from '@clerk/backend/internal';
      
    • Drop the above exports from the top-level api:
      // Before
      import { AuthStatus, ... } from '@clerk/backend';
      // After
      import { AuthStatus, ... } from '@clerk/backend/internal';
      
      Dropping those exports results in also dropping the exports from gatsby-plugin-clerk, @clerk/clerk-sdk-node, @clerk/backend, @clerk/fastify, @clerk/nextjs, @clerk/remix packages.
  • Changes in exports of @clerk/backend: (#2365) by @dimkl

    • Drop the following internal exports from the top-level api:
      // Before
      import {
        AllowlistIdentifier,
        Client,
        DeletedObject,
        Email,
        EmailAddress,
        ExternalAccount,
        IdentificationLink,
        Invitation,
        OauthAccessToken,
        ObjectType,
        Organization,
        OrganizationInvitation,
        OrganizationMembership,
        OrganizationMembershipPublicUserData,
        PhoneNumber,
        RedirectUrl,
        SMSMessage,
        Session,
        SignInToken,
        Token,
        User,
        Verification,
      } from '@clerk/backend';
      // After : no alternative since there is no need to use those classes
      
      Dropping those exports results in also dropping the exports from gatsby-plugin-clerk, @clerk/clerk-sdk-node, @clerk/backend, @clerk/fastify, @clerk/nextjs, @clerk/remix packages.
    • Keep those 3 resource related type exports
      import type { Organization, Session, User, WebhookEvent, WebhookEventType } from '@clerk/backend';
      
  • Changes in exports of @clerk/backend: (#2364) by @dimkl

    • Expose the following helpers and enums from @clerk/backend/jwt:
      import { decodeJwt, hasValidSignature, signJwt, verifyJwt } from '@clerk/backend/jwt';
      
    • Drop the above exports from the top-level api:
      // Before
      import { decodeJwt, ... } from '@clerk/backend';
      // After
      import { decodeJwt, ... } from '@clerk/backend/jwt';
      
      Dropping those exports results in also dropping the exports from gatsby-plugin-clerk, @clerk/clerk-sdk-node, @clerk/backend, @clerk/fastify, @clerk/nextjs, @clerk/remix packages.
  • Changes in @clerk/backend exports: (#2362) by @dimkl

    • Drop Internal deserialize helper
    • Introduce /errors subpath export, eg:
      import {
        TokenVerificationError,
        TokenVerificationErrorAction,
        TokenVerificationErrorCode,
        TokenVerificationErrorReason,
      } from '@clerk/backend/errors';
      
    • Drop errors from top-level export
      // Before
      import { TokenVerificationError, TokenVerificationErrorReason } from '@clerk/backend';
      // After
      import { TokenVerificationError, TokenVerificationErrorReason } from '@clerk/backend/errors';
      
  • Use NEXT_PUBLIC_CLERK_JS_URL instead of NEXT_PUBLIC_CLERK_JS to pin a specific @clerk/clerk-js version. (#2374) by @SokratisVidros

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Major Changes

  • Remove hashing and third-party cookie functionality related to development instance session syncing in favor of URL-based session syncing with query parameters. (#2367) by @tmilewski
javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Major Changes

  • Drop all pre-instantiated Backend API resources (allowlistIdentifiers, clients, emailAddresses, emails, invitations, organizations, phoneNumbers, redirectUrls, sessions, signInTokens, users, domains). Use the clerkClient import instead. (#2362) by @dimkl

    // Before
    import { users } from '@clerk/clerk-sdk-node';
    // After
    import { clerkClient } from '@clerk/clerk-sdk-node';
    clerkClient.users;
    
  • Changes in exports of @clerk/backend: (#2363) by @dimkl

    • Expose the following helpers and enums from @clerk/backend/internal:
      import {
        AuthStatus,
        buildRequestUrl,
        constants,
        createAuthenticateRequest,
        createIsomorphicRequest,
        debugRequestState,
        makeAuthObjectSerializable,
        prunePrivateMetadata,
        redirect,
        sanitizeAuthObject,
        signedInAuthObject,
        signedOutAuthObject,
      } from '@clerk/backend/internal';
      
    • Drop the above exports from the top-level api:
      // Before
      import { AuthStatus, ... } from '@clerk/backend';
      // After
      import { AuthStatus, ... } from '@clerk/backend/internal';
      
      Dropping those exports results in also dropping the exports from gatsby-plugin-clerk, @clerk/clerk-sdk-node, @clerk/backend, @clerk/fastify, @clerk/nextjs, @clerk/remix packages.
  • Changes in exports of @clerk/backend: (#2365) by @dimkl

    • Drop the following internal exports from the top-level api:
      // Before
      import {
        AllowlistIdentifier,
        Client,
        DeletedObject,
        Email,
        EmailAddress,
        ExternalAccount,
        IdentificationLink,
        Invitation,
        OauthAccessToken,
        ObjectType,
        Organization,
        OrganizationInvitation,
        OrganizationMembership,
        OrganizationMembershipPublicUserData,
        PhoneNumber,
        RedirectUrl,
        SMSMessage,
        Session,
        SignInToken,
        Token,
        User,
        Verification,
      } from '@clerk/backend';
      // After : no alternative since there is no need to use those classes
      
      Dropping those exports results in also dropping the exports from gatsby-plugin-clerk, @clerk/clerk-sdk-node, @clerk/backend, @clerk/fastify, @clerk/nextjs, @clerk/remix packages.
    • Keep those 3 resource related type exports
      import type { Organization, Session, User, WebhookEvent, WebhookEventType } from '@clerk/backend';
      
  • Changes in exports of @clerk/backend: (#2364) by @dimkl

    • Expose the following helpers and enums from @clerk/backend/jwt:
      import { decodeJwt, hasValidSignature, signJwt, verifyJwt } from '@clerk/backend/jwt';
      
    • Drop the above exports from the top-level api:
      // Before
      import { decodeJwt, ... } from '@clerk/backend';
      // After
      import { decodeJwt, ... } from '@clerk/backend/jwt';
      
      Dropping those exports results in also dropping the exports from gatsby-plugin-clerk, @clerk/clerk-sdk-node, @clerk/backend, @clerk/fastify, @clerk/nextjs, @clerk/remix packages.
  • Changes in @clerk/backend exports: (#2362) by @dimkl

    • Drop Internal deserialize helper
    • Introduce /errors subpath export, eg:
      import {
        TokenVerificationError,
        TokenVerificationErrorAction,
        TokenVerificationErrorCode,
        TokenVerificationErrorReason,
      } from '@clerk/backend/errors';
      
    • Drop errors from top-level export
      // Before
      import { TokenVerificationError, TokenVerificationErrorReason } from '@clerk/backend';
      // After
      import { TokenVerificationError, TokenVerificationErrorReason } from '@clerk/backend/errors';
      

Minor Changes

  • Fix error thrown for undefined Clerk in case of using default clerkClient from @clerk/clerk-sdk-node without secretKey caused by replaced import. (#2368) by @dimkl

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Major Changes

  • Update @clerk/remix's rootAuthLoader and getAuth helpers to handle handshake auth status, this replaces the previous interstitial flow. As a result of this, the ClerkErrorBoundary is no longer necessary and has been removed. (#2380) by @BRKalow

    To migrate, remove usage of ClerkErrorBoundary:

    - import { ClerkApp, ClerkErrorBoundary } from "@clerk/remix";
    + import { ClerkApp } from "@clerk/remix";
    
    ...
    
    - export const ErrorBoundary = ClerkErrorBoundary();
    
  • Changes in exports of @clerk/backend: (#2363) by @dimkl

    • Expose the following helpers and enums from @clerk/backend/internal:
      import {
        AuthStatus,
        buildRequestUrl,
        constants,
        createAuthenticateRequest,
        createIsomorphicRequest,
        debugRequestState,
        makeAuthObjectSerializable,
        prunePrivateMetadata,
        redirect,
        sanitizeAuthObject,
        signedInAuthObject,
        signedOutAuthObject,
      } from '@clerk/backend/internal';
      
    • Drop the above exports from the top-level api:
      // Before
      import { AuthStatus, ... } from '@clerk/backend';
      // After
      import { AuthStatus, ... } from '@clerk/backend/internal';
      
      Dropping those exports results in also dropping the exports from gatsby-plugin-clerk, @clerk/clerk-sdk-node, @clerk/backend, @clerk/fastify, @clerk/nextjs, @clerk/remix packages.
  • Changes in exports of @clerk/backend: (#2365) by @dimkl

    • Drop the following internal exports from the top-level api:
      // Before
      import {
        AllowlistIdentifier,
        Client,
        DeletedObject,
        Email,
        EmailAddress,
        ExternalAccount,
        IdentificationLink,
        Invitation,
        OauthAccessToken,
        ObjectType,
        Organization,
        OrganizationInvitation,
        OrganizationMembership,
        OrganizationMembershipPublicUserData,
        PhoneNumber,
        RedirectUrl,
        SMSMessage,
        Session,
        SignInToken,
        Token,
        User,
        Verification,
      } from '@clerk/backend';
      // After : no alternative since there is no need to use those classes
      
      Dropping those exports results in also dropping the exports from gatsby-plugin-clerk, @clerk/clerk-sdk-node, @clerk/backend, @clerk/fastify, @clerk/nextjs, @clerk/remix packages.
    • Keep those 3 resource related type exports
      import type { Organization, Session, User, WebhookEvent, WebhookEventType } from '@clerk/backend';
      

Patch Changes

javascript - [email protected]

Published by clerk-cookie 10 months ago

Major Changes

  • Changes in exports of @clerk/backend: (#2363) by @dimkl

    • Expose the following helpers and enums from @clerk/backend/internal:
      import {
        AuthStatus,
        buildRequestUrl,
        constants,
        createAuthenticateRequest,
        createIsomorphicRequest,
        debugRequestState,
        makeAuthObjectSerializable,
        prunePrivateMetadata,
        redirect,
        sanitizeAuthObject,
        signedInAuthObject,
        signedOutAuthObject,
      } from '@clerk/backend/internal';
      
    • Drop the above exports from the top-level api:
      // Before
      import { AuthStatus, ... } from '@clerk/backend';
      // After
      import { AuthStatus, ... } from '@clerk/backend/internal';
      
      Dropping those exports results in also dropping the exports from gatsby-plugin-clerk, @clerk/clerk-sdk-node, @clerk/backend, @clerk/fastify, @clerk/nextjs, @clerk/remix packages.
  • Changes in exports of @clerk/backend: (#2365) by @dimkl

    • Drop the following internal exports from the top-level api:
      // Before
      import {
        AllowlistIdentifier,
        Client,
        DeletedObject,
        Email,
        EmailAddress,
        ExternalAccount,
        IdentificationLink,
        Invitation,
        OauthAccessToken,
        ObjectType,
        Organization,
        OrganizationInvitation,
        OrganizationMembership,
        OrganizationMembershipPublicUserData,
        PhoneNumber,
        RedirectUrl,
        SMSMessage,
        Session,
        SignInToken,
        Token,
        User,
        Verification,
      } from '@clerk/backend';
      // After : no alternative since there is no need to use those classes
      
      Dropping those exports results in also dropping the exports from gatsby-plugin-clerk, @clerk/clerk-sdk-node, @clerk/backend, @clerk/fastify, @clerk/nextjs, @clerk/remix packages.
    • Keep those 3 resource related type exports
      import type { Organization, Session, User, WebhookEvent, WebhookEventType } from '@clerk/backend';
      

Patch Changes

javascript - @clerk/[email protected]

Published by clerk-cookie 10 months ago

Patch Changes