Skip to content

Latest commit

 

History

History
1974 lines (1359 loc) · 116 KB

File metadata and controls

1974 lines (1359 loc) · 116 KB

@clerk/nuxt

2.0.7

Patch Changes

2.0.6

Patch Changes

  • Updated dependencies [f0533a2, e00ec97]:
    • @clerk/shared@4.3.2
    • @clerk/backend@3.2.2
    • @clerk/vue@2.0.6

2.0.5

Patch Changes

  • Updated dependencies [b9cb6e5]:
    • @clerk/shared@4.3.1
    • @clerk/vue@2.0.5
    • @clerk/backend@3.2.1

2.0.4

Patch Changes

  • Updated dependencies [1f43bf7, 766ae5b, de1386f]:
    • @clerk/backend@3.2.0
    • @clerk/shared@4.3.0
    • @clerk/vue@2.0.4

2.0.3

Patch Changes

  • Updated dependencies [3e63793]:
    • @clerk/backend@3.1.0
    • @clerk/shared@4.2.0
    • @clerk/vue@2.0.3

2.0.2

Patch Changes

2.0.1

Patch Changes

  • Update README prerequisites to match actual package.json engine and peer dependency constraints. (#7972) by @jacekradko

  • Updated dependencies [55ece85]:

    • @clerk/backend@3.0.1
    • @clerk/vue@2.0.1

2.0.0

Major Changes

  • Require Node.js 20.9.0 in all packages (#7262) by @jacekradko

  • Remove clerkJSUrl, clerkJSVersion, clerkUIUrl, and clerkUIVersion props from all SDKs. To pin a specific version of @clerk/clerk-js, import the Clerk constructor from @clerk/clerk-js and pass it to ClerkProvider via the Clerk prop. To pin a specific version of @clerk/ui, import ui from @clerk/ui and pass it via the ui prop. This bundles the modules directly with your application instead of loading them from the CDN. (#7879) by @jacekradko

  • Introduce <Show when={...}> as the cross-framework authorization control component and remove <Protect>, <SignedIn>, and <SignedOut> in favor of <Show>. (#7373) by @jacekradko

  • Removed deprecated getAuth() helper. Use event.context.auth() in your server routes instead. (#7284) by @wobsoriano

    export default defineEventHandler(event => {
      const { userId } = event.context.auth();
    
      return {
        userId,
      };
    });
  • getToken() now throws ClerkOfflineError instead of returning null when the client is offline. (#7598) by @bratsos

    This makes it explicit that a token fetch failure was due to network conditions, not authentication state. Previously, returning null could be misinterpreted as "user is signed out," potentially causing the cached token to be cleared.

    To handle this change, catch ClerkOfflineError from getToken() calls:

    import { ClerkOfflineError } from '@clerk/react/errors';
    
    try {
      const token = await session.getToken();
    } catch (error) {
      if (ClerkOfflineError.is(error)) {
        // Handle offline scenario - show offline UI, retry later, etc.
      }
      throw error;
    }
  • Routing strategy for the ff. components now default to path: (#7260) by @wobsoriano

    • <SignIn />
    • <SignUp />
    • <UserProfile />
    • <OrganizationProfile />
    • <CreateOrganization />
    • <OrganizationList />

Minor Changes

  • Remove clerkJSVariant option and headless bundle. Use prefetchUI={false} instead. (#7629) by @jacekradko

  • Add standalone getToken() function for retrieving session tokens outside of framework component trees. (#7325) by @bratsos

    This function is safe to call from anywhere in the browser, such as API interceptors, data fetching layers (e.g., React Query, SWR), or vanilla JavaScript code. It automatically waits for Clerk to initialize before returning the token.

    import { getToken } from '@clerk/nextjs'; // or any framework package

    // Example: Axios interceptor axios.interceptors.request.use(async (config) => { const token = await getToken(); if (token) { config.headers.Authorization = Bearer ${token}; } return config; });

  • Add /types subpath export to re-export types from @clerk/shared/types along with SDK-specific types. This allows importing Clerk types directly from the SDK package (e.g., import type { UserResource } from '@clerk/react/types') without needing to install @clerk/types as a separate dependency. (#7644) by @nikosdouvlis

  • Introduce <UNSAFE_PortalProvider> component which allows you to specify a custom container for Clerk floating UI elements (popovers, modals, tooltips, etc.) that use portals. Only Clerk components within the provider will be affected, components outside the provider will continue to use the default document.body for portals. (#7310) by @alexcarpenter

    This is particularly useful when using Clerk components inside external UI libraries like Radix Dialog or React Aria Components, where portaled elements need to render within the dialog's container to remain interact-able.

    'use client';
    
    import { useRef } from 'react';
    import * as Dialog from '@radix-ui/react-dialog';
    import { UNSAFE_PortalProvider, UserButton } from '@clerk/nextjs';
    
    export function UserDialog() {
      const containerRef = useRef<HTMLDivElement>(null);
    
      return (
        <Dialog.Root>
          <Dialog.Trigger>Open Dialog</Dialog.Trigger>
          <Dialog.Portal>
            <Dialog.Overlay />
            <Dialog.Content ref={containerRef}>
              <UNSAFE_PortalProvider getContainer={() => containerRef.current}>
                <UserButton />
              </UNSAFE_PortalProvider>
            </Dialog.Content>
          </Dialog.Portal>
        </Dialog.Root>
      );
    }

Patch Changes

1.13.26

Patch Changes

  • Updated dependencies [76a5a1b, 7955e9d, 51bc9a9]:
    • @clerk/backend@2.33.0
    • @clerk/shared@3.47.2
    • @clerk/types@4.101.20
    • @clerk/vue@1.17.18

1.13.25

Patch Changes

  • Updated dependencies [8a0c404]:
    • @clerk/shared@3.47.1
    • @clerk/backend@2.32.2
    • @clerk/types@4.101.19
    • @clerk/vue@1.17.17

1.13.24

Patch Changes

  • Updated dependencies [c15c8a2]:
    • @clerk/backend@2.32.1

1.13.23

Patch Changes

  • Updated dependencies [c00c524, 9c935ad]:
    • @clerk/shared@3.47.0
    • @clerk/backend@2.32.0
    • @clerk/types@4.101.18
    • @clerk/vue@1.17.16

1.13.22

Patch Changes

  • Updated dependencies [71bd53c, 935f780, 2471e31]:
    • @clerk/shared@3.46.0
    • @clerk/backend@2.31.2
    • @clerk/types@4.101.17
    • @clerk/vue@1.17.15

1.13.21

Patch Changes

  • Updated dependencies [b17e4bb]:
    • @clerk/shared@3.45.1
    • @clerk/backend@2.31.1
    • @clerk/types@4.101.16
    • @clerk/vue@1.17.14

1.13.20

Patch Changes

  • Updated dependencies [35bcbd1, 5740640, 03c61c1]:
    • @clerk/shared@3.45.0
    • @clerk/backend@2.31.0
    • @clerk/types@4.101.15
    • @clerk/vue@1.17.13

1.13.19

Patch Changes

  • Updated dependencies [a726252]:
    • @clerk/backend@2.30.1

1.13.18

Patch Changes

1.13.17

Patch Changes

  • Updated dependencies [559cd84]:
    • @clerk/backend@2.29.7

1.13.16

Patch Changes

  • Updated dependencies [64a35f7]:
    • @clerk/shared@3.44.0
    • @clerk/backend@2.29.6
    • @clerk/types@4.101.14
    • @clerk/vue@1.17.11

1.13.15

Patch Changes

  • Updated dependencies [b7a4e1e]:
    • @clerk/shared@3.43.2
    • @clerk/backend@2.29.5
    • @clerk/types@4.101.13
    • @clerk/vue@1.17.10

1.13.14

Patch Changes

  • Updated dependencies [e995cc3]:
    • @clerk/shared@3.43.1
    • @clerk/backend@2.29.4
    • @clerk/types@4.101.12
    • @clerk/vue@1.17.9

1.13.13

Patch Changes

  • Updated dependencies [c3ff1f8, 271ddeb]:
    • @clerk/backend@2.29.3
    • @clerk/shared@3.43.0
    • @clerk/types@4.101.11
    • @clerk/vue@1.17.8

1.13.12

Patch Changes

  • Updated dependencies [6b26afc]:
    • @clerk/backend@2.29.2

1.13.11

Patch Changes

  • Updated dependencies [9320c4f, a4e6932]:
    • @clerk/backend@2.29.1
    • @clerk/shared@3.42.0
    • @clerk/types@4.101.10
    • @clerk/vue@1.17.7

1.13.10

Patch Changes

  • Updated dependencies [ede3e2a, 03dd374]:
    • @clerk/backend@2.29.0
    • @clerk/shared@3.41.1
    • @clerk/types@4.101.9
    • @clerk/vue@1.17.6

1.13.9

Patch Changes

1.13.8

Patch Changes

1.13.7

Patch Changes

  • Updated dependencies [e448757]:
    • @clerk/backend@2.27.0

1.13.6

Patch Changes

  • Updated dependencies [0307ea8, b117ebc, 6dbb02b]:
    • @clerk/vue@1.17.3
    • @clerk/shared@3.39.0
    • @clerk/backend@2.26.0
    • @clerk/types@4.101.6

1.13.5

Patch Changes

1.13.4

Patch Changes

1.13.3

Patch Changes

  • Updated dependencies [f85abda, 36e43cc, 337430b]:
    • @clerk/shared@3.36.0
    • @clerk/vue@1.17.0
    • @clerk/backend@2.24.0
    • @clerk/types@4.101.3

1.13.2

Patch Changes

  • Updated dependencies [d8f59a6]:
    • @clerk/shared@3.35.2
    • @clerk/backend@2.23.2
    • @clerk/types@4.101.2
    • @clerk/vue@1.16.2

1.13.1

Patch Changes

  • Updated dependencies [a9c13ca]:
    • @clerk/shared@3.35.1
    • @clerk/backend@2.23.1
    • @clerk/types@4.101.1
    • @clerk/vue@1.16.1

1.13.0

Minor Changes

Patch Changes

1.12.1

Patch Changes

1.12.0

Minor Changes

Patch Changes

  • Updated dependencies [613cb97]:
    • @clerk/shared@3.33.0
    • @clerk/backend@2.21.0
    • @clerk/types@4.99.0
    • @clerk/vue@1.15.0

1.11.6

Patch Changes

1.11.5

Patch Changes

  • Updated dependencies [a474c59, b505755, 5536429]:
    • @clerk/shared@3.31.1
    • @clerk/backend@2.20.0
    • @clerk/types@4.97.2
    • @clerk/vue@1.14.12

1.11.4

Patch Changes

  • Updated dependencies [85b5acc, ea65d39, b09b29e]:
    • @clerk/types@4.97.1
    • @clerk/shared@3.31.0
    • @clerk/backend@2.19.3
    • @clerk/vue@1.14.11

1.11.3

Patch Changes

  • Updated dependencies [3e0ef92, 2587aa6]:
    • @clerk/shared@3.30.0
    • @clerk/types@4.97.0
    • @clerk/backend@2.19.2
    • @clerk/vue@1.14.10

1.11.2

Patch Changes

1.11.1

Patch Changes

  • Updated dependencies [4d46e4e, a42a015, 8ebbf1e]:
    • @clerk/types@4.95.1
    • @clerk/backend@2.19.0
    • @clerk/shared@3.28.3
    • @clerk/vue@1.14.8

1.11.0

Minor Changes

Patch Changes

  • Updated dependencies [a172d51, 947d0f5]:
    • @clerk/types@4.95.0
    • @clerk/shared@3.28.2
    • @clerk/backend@2.18.3
    • @clerk/vue@1.14.7

1.10.3

Patch Changes

  • Updated dependencies [d8147fb]:
    • @clerk/shared@3.28.1
    • @clerk/backend@2.18.2
    • @clerk/vue@1.14.6

1.10.2

Patch Changes

1.10.1

Patch Changes

1.10.0

Minor Changes

  • Remove added nextTick() calls when invoking Clerk routing functions. (#6928) by @wobsoriano

Patch Changes

  • Updated dependencies [fba4781, a1f6714]:
    • @clerk/types@4.92.0
    • @clerk/backend@2.17.2
    • @clerk/shared@3.27.3
    • @clerk/vue@1.14.3

1.9.3

Patch Changes

  • Updated dependencies [04cba7d, f737d26, 8777f35, 2c0128b]:
    • @clerk/backend@2.17.1
    • @clerk/types@4.91.0
    • @clerk/shared@3.27.2
    • @clerk/vue@1.14.2

1.9.2

Patch Changes

  • Updated dependencies [ea2bc26, 37028ca]:
    • @clerk/backend@2.17.0
    • @clerk/types@4.90.0
    • @clerk/shared@3.27.1
    • @clerk/vue@1.14.1

1.9.1

Patch Changes

1.9.0

Minor Changes

Patch Changes

1.8.18

Patch Changes

1.8.17

Patch Changes

1.8.16

Patch Changes

1.8.15

Patch Changes

  • Updated dependencies [fced4fc, ea65f20, e6e19d2, 1b1e8b1]:
    • @clerk/types@4.84.1
    • @clerk/vue@1.12.0
    • @clerk/shared@3.24.1
    • @clerk/backend@2.12.1

1.8.14

Patch Changes

1.8.13

Patch Changes

1.8.12

Patch Changes

  • Updated dependencies [600c648]:
    • @clerk/shared@3.23.0
    • @clerk/types@4.83.0
    • @clerk/backend@2.10.1
    • @clerk/vue@1.11.6

1.8.11

Patch Changes

  • Allows passing of treatPendingAsSignedOut to auth functions: (#6612) by @wobsoriano

    TanStack Start

    const authStateFn = createServerFn({ method: 'GET' }).handler(async () => {
      const request = getWebRequest();
      const { userId } = await getAuth(request, { treatPendingAsSignedOut: false }); // defaults to true
    
      return { userId };
    });

    Nuxt

    export default eventHandler(event => {
      const { userId } = event.context.auth({ treatPendingAsSignedOut: false }); // defaults to true
    
      return { userId };
    });
  • Updated dependencies [f49ec31, d52714e, 822e4a1, ce49740, ba7f3fd, 9036427, 2ed539c, deaafe4, a26ecae, c16a7a5, 05b6d65, 453cf86]:

    • @clerk/backend@2.10.0
    • @clerk/types@4.82.0
    • @clerk/shared@3.22.1
    • @clerk/vue@1.11.5

1.8.10

Patch Changes

1.8.9

Patch Changes

  • Updated dependencies [8dc6bad, aa6a3c3, db50c47]:
    • @clerk/types@4.80.0
    • @clerk/backend@2.9.3
    • @clerk/shared@3.21.2
    • @clerk/vue@1.11.3

1.8.8

Patch Changes

  • Updated dependencies [413468c, 7b7eb1f]:
    • @clerk/shared@3.21.1
    • @clerk/types@4.79.0
    • @clerk/backend@2.9.2
    • @clerk/vue@1.11.2

1.8.7

Patch Changes

  • Fix export of RedirectToTasks control component (#6546) by @LauraBeatris

  • Updated dependencies [83757e7, 5b24129]:

    • @clerk/vue@1.11.1
    • @clerk/shared@3.21.0
    • @clerk/types@4.78.0
    • @clerk/backend@2.9.1

1.8.6

Patch Changes

1.8.5

Patch Changes

1.8.4

Patch Changes

1.8.3

Patch Changes

  • Add ability to define a machine secret key to Clerk BAPI client function (#6479) by @wobsoriano

    const clerkClient = createClerkClient({ machineSecretKey: 'ak_xxxxx' })
    
    clerkClient.m2mTokens.create({...})
  • Updated dependencies [1ad16da, 4edef81, 6ff416f, e82f177, 696f8e1, f318d22, 0d27281, 1cc66ab]:

    • @clerk/types@4.74.0
    • @clerk/backend@2.7.0
    • @clerk/shared@3.18.1
    • @clerk/vue@1.9.3

1.8.2

Patch Changes

1.8.1

Patch Changes

1.8.0

Minor Changes

  • Introduces machine authentication, supporting four token types: api_key, oauth_token, machine_token, and session_token. For backwards compatibility, session_token remains the default when no token type is specified. This enables machine-to-machine authentication and use cases such as API keys and OAuth integrations. Existing applications continue to work without modification. (#6391) by @wobsoriano

    You can specify which token types are allowed by using the acceptsToken option in the event.context.auth() context. This option can be set to a specific type, an array of types, or 'any' to accept all supported tokens.

    Example usage:

    export default eventHandler(event => {
      const auth = event.locals.auth({ acceptsToken: 'any' });
    
      if (authObject.tokenType === 'session_token') {
        console.log('this is session token from a user');
      } else {
        console.log('this is some other type of machine token');
        console.log('more specifically, a ' + authObject.tokenType);
      }
    
      return {};
    });

Patch Changes

1.7.14

Patch Changes

  • Updated dependencies [2bbeaf3, b0fdc9e]:
    • @clerk/backend@2.6.0
    • @clerk/types@4.70.1
    • @clerk/shared@3.15.1
    • @clerk/vue@1.8.21

1.7.13

Patch Changes

  • Updated dependencies [cd59c0e, cd59c0e]:
    • @clerk/types@4.70.0
    • @clerk/shared@3.15.0
    • @clerk/backend@2.5.2
    • @clerk/vue@1.8.20

1.7.12

Patch Changes

1.7.11

Patch Changes

1.7.10

Patch Changes

  • Updated dependencies [2a90b68, af50905]:
    • @clerk/types@4.67.0
    • @clerk/shared@3.12.3
    • @clerk/backend@2.4.5
    • @clerk/vue@1.8.17

1.7.9

Patch Changes

  • Updated dependencies [8ee859c]:
    • @clerk/shared@3.12.2
    • @clerk/types@4.66.1
    • @clerk/backend@2.4.4
    • @clerk/vue@1.8.16

1.7.8

Patch Changes

  • Updated dependencies [025e304, dedf487, b96114e]:
    • @clerk/types@4.66.0
    • @clerk/backend@2.4.3
    • @clerk/shared@3.12.1
    • @clerk/vue@1.8.15

1.7.7

Patch Changes

1.7.6

Patch Changes

  • Updated dependencies [f42c4fe, ec207dc, ec207dc, 0e0cc1f]:
    • @clerk/types@4.64.0
    • @clerk/shared@3.11.0
    • @clerk/backend@2.4.1
    • @clerk/vue@1.8.13

1.7.5

Patch Changes

1.7.4

Patch Changes

  • Updated dependencies [02a1f42, edc0bfd]:
    • @clerk/shared@3.10.1
    • @clerk/types@4.62.1
    • @clerk/vue@1.8.11
    • @clerk/backend@2.3.1

1.7.3

Patch Changes

  • Updated dependencies [f1be1fe, 8bfdf94, bffb42a, 084e7cc]:
    • @clerk/types@4.62.0
    • @clerk/backend@2.3.0
    • @clerk/shared@3.10.0
    • @clerk/vue@1.8.10

1.7.2

Patch Changes

1.7.1

Patch Changes

1.7.0

Minor Changes

  • Machine authentication is now supported for advanced use cases via the backend SDK. You can use clerkClient.authenticateRequest to validate machine tokens (such as API keys, OAuth tokens, and machine-to-machine tokens). No new helpers are included in these packages yet. (#5689) by @wobsoriano

    Example (Astro):

    import { clerkClient } from '@clerk/astro/server';
    
    export const GET: APIRoute = ({ request }) => {
      const requestState = await clerkClient.authenticateRequest(request, {
        acceptsToken: 'api_key',
      });
    
      if (!requestState.isAuthenticated) {
        return new Response(401, { message: 'Unauthorized' });
      }
    
      return new Response(JSON.stringify(requestState.toAuth()));
    };
  • The svix dependency is no longer needed when using the verifyWebhook() function. verifyWebhook() was refactored to not rely on svix anymore while keeping the same functionality and behavior. (#6059) by @royanger

    If you previously installed svix to use verifyWebhook() you can uninstall it now:

    npm uninstall svix

Patch Changes

1.6.9

Patch Changes

1.6.8

Patch Changes

  • Updated dependencies [6ed3dfc, 22c3363, ac6b231]:
    • @clerk/types@4.59.2
    • @clerk/backend@1.33.1
    • @clerk/shared@3.9.4
    • @clerk/vue@1.8.5

1.6.7

Patch Changes

  • Updated dependencies [ced8912, f237d76, 5f1375b]:
    • @clerk/backend@1.33.0
    • @clerk/shared@3.9.3
    • @clerk/vue@1.8.4

1.6.6

Patch Changes

  • Updated dependencies [c305b31, b813cbe, 6bb480e]:
    • @clerk/types@4.59.1
    • @clerk/backend@1.32.3
    • @clerk/shared@3.9.2
    • @clerk/vue@1.8.3

1.6.5

Patch Changes

1.6.4

Patch Changes

  • Add isSatellite prop type in Vue and Nuxt SDKs (#5911) by @wobsoriano

  • Updated dependencies [1ff6d6e, 80bdc58, fbf3cf4]:

    • @clerk/shared@3.9.0
    • @clerk/types@4.58.1
    • @clerk/vue@1.8.1
    • @clerk/backend@1.32.1

1.6.3

Patch Changes

1.6.2

Patch Changes

1.6.1

Patch Changes

1.6.0

Minor Changes

Patch Changes

  • Updated dependencies [9ec0a73, d9222fc, 56ba4e2]:
    • @clerk/types@4.56.3
    • @clerk/vue@1.7.0
    • @clerk/backend@1.31.2
    • @clerk/shared@3.7.8

1.5.13

Patch Changes

  • Updated dependencies [225b9ca]:
    • @clerk/types@4.56.2
    • @clerk/backend@1.31.1
    • @clerk/shared@3.7.7
    • @clerk/vue@1.6.8

1.5.12

Patch Changes

1.5.11

Patch Changes

  • Fix handshake redirect loop in applications deployed to Netlify with a Clerk development instance. (#5656) by @wobsoriano

  • Updated dependencies [387bf62, 2716622, 294da82, 4a8fe40]:

    • @clerk/types@4.56.1
    • @clerk/shared@3.7.6
    • @clerk/backend@1.30.2
    • @clerk/vue@1.6.7

1.5.10

Patch Changes

1.5.9

Patch Changes

  • Updated dependencies [ba19465, 8b25035]:
    • @clerk/backend@1.30.0
    • @clerk/types@4.55.1
    • @clerk/shared@3.7.4
    • @clerk/vue@1.6.5

1.5.8

Patch Changes

  • Updated dependencies [33201bf, 4334598, 0ae0403]:
    • @clerk/types@4.55.0
    • @clerk/backend@1.29.2
    • @clerk/shared@3.7.3
    • @clerk/vue@1.6.4

1.5.7

Patch Changes

1.5.6

Patch Changes

1.5.5

Patch Changes

1.5.4

Patch Changes

1.5.3

Patch Changes

1.5.2

Patch Changes

  • Updated dependencies [f6f275d]:
    • @clerk/backend@1.27.1
    • @clerk/types@4.51.1
    • @clerk/shared@3.4.1
    • @clerk/vue@1.5.1

1.5.1

Patch Changes

1.5.0

Minor Changes

  • Deprecate event.context.auth in favor of event.context.auth() as function (#5513) by @LauraBeatris

    export default clerkMiddleware((event) => {
    + const { userId } = event.context.auth()
    - const { userId } = event.context.auth
      const isAdminRoute = event.path.startsWith('/api/admin')
    
      if (!userId && isAdminRoute) {
        throw createError({
          statusCode: 401,
          statusMessage: 'Unauthorized: User not signed in',
        })
      }
    })
  • Introduce a verifyWebhook() function to verify incoming Clerk webhook requests and process the payload. This function handles webhook signature verification using Svix and is now available across all backend and fullstack SDKs. (#5468) by @wobsoriano

    To get started, install svix, which Clerk uses to verify its webhooks:

    npm install svix

    Then in your webhook route handler, import verifyWebhook() from the Nuxt SDK:

    // server/api/webhooks.post.ts
    import { verifyWebhook } from '@clerk/nuxt/webhooks';
    
    export default eventHandler(async event => {
      try {
        const evt = await verifyWebhook(event);
    
        // Do something with payload
        const { id } = evt.data;
        const eventType = evt.type;
        console.log(`Received webhook with ID ${id} and event type of ${eventType}`);
        console.log('Webhook payload:', body);
    
        return 'Webhook received';
      } catch (err) {
        console.error('Error: Could not verify webhook:', err);
        setResponseStatus(event, 400);
        return 'Error: Verification error';
      }
    });

    For more information on how to sync Clerk data to your app with webhooks, see our guide.

Patch Changes

1.4.6

Patch Changes

  • Updated dependencies [e20fb6b, 77e6462]:
    • @clerk/shared@3.2.3
    • @clerk/types@4.50.1
    • @clerk/backend@1.25.8
    • @clerk/vue@1.4.5

1.4.5

Patch Changes

1.4.4

Patch Changes

  • Updated dependencies [27d66a5, 466ed13]:
    • @clerk/backend@1.25.6
    • @clerk/types@4.49.2
    • @clerk/shared@3.2.1
    • @clerk/vue@1.4.3

1.4.3

Patch Changes

  • Updated dependencies [892bc0e, 892bc0e]:
    • @clerk/backend@1.25.5
    • @clerk/shared@3.2.0
    • @clerk/vue@1.4.2

1.4.2

Patch Changes

  • Updated dependencies [facefaf, 3910ebe, e513333]:
    • @clerk/backend@1.25.4
    • @clerk/types@4.49.1
    • @clerk/shared@3.1.0
    • @clerk/vue@1.4.1

1.4.1

Patch Changes

1.4.0

Minor Changes

  • Bump @nuxt/* dependencies to 3.16.0 and add proper typing for event.context.auth object in event handlers (#5300) by @wobsoriano

    export default eventHandler(event => {
      const { userId } = event.context.auth; // auth is now typed
    
      // ...
    
      return { userId };
    });

Patch Changes

1.3.2

Patch Changes

1.3.1

Patch Changes

1.3.0

Minor Changes

  • Introduce updateClerkOptions() utility function to update Clerk options on the fly. (#5235) by @wobsoriano

    Usage:

    <script setup>
    import { updateClerkOptions } from '@clerk/vue';
    import { dark } from '@clerk/themes';
    import { frFR } from '@clerk/localizations';
    
    function enableDarkTheme() {
      updateClerkOptions({
        appearance: {
          baseTheme: dark,
        },
      });
    }
    
    function changeToFrench() {
      updateClerkOptions({
        localization: frFR,
      });
    }
    </script>
    
    <template>
      <button @click="enableDarkTheme">Enable Dark Theme</button>
      <button @click="changeToFrench">Change to French</button>
    </template>

Patch Changes

1.2.0

Minor Changes

  • Introduce getAuth() helper to retrieve authentication state from the event object. (#5158) by @wobsoriano

    Example:

    import { getAuth } from '@clerk/nuxt/server';
    
    export default eventHandler(event => {
      const { userId } = getAuth(event);
    
      if (!userId) {
        // User is not authenticated
      }
    });

Patch Changes

  • Re-export error handling utilities from @clerk/shared (#5155) by @wobsoriano

    Example:

    <script setup lang="ts">
    import { useSignIn } from '@clerk/vue';
    import { isClerkAPIResponseError } from '@clerk/vue/errors';
    
    // ... form state refs and other setup ...
    const { signIn } = useSignIn();
    
    const handleSubmit = async () => {
      try {
        const signInAttempt = await signIn.value.create({
          identifier: email.value,
          password: password.value,
        });
        // ... handle successful sign in ...
      } catch (err) {
        // Type guard to safely handle Clerk API errors
        if (isClerkAPIResponseError(err)) {
          errors.value = err.errors; // err.errors is properly typed as ClerkAPIError[]
        }
      }
    };
    </script>
    
    <template>
      <!-- Form template here -->
    </template>
  • Updated dependencies [d76c4699990b8477745c2584b1b98d5c92f9ace6, a9b0087fca3f427f65907b358d9b5bc0c95921d8, 92d17d7c087470b262fa5407cb6720fe6b17d333, 62200fad4431d625fcb4bf2a521e4650eb615381]:

    • @clerk/shared@2.22.0
    • @clerk/types@4.46.1
    • @clerk/vue@1.2.1
    • @clerk/backend@1.24.2

1.1.4

Patch Changes

1.1.3

Patch Changes

1.1.2

Patch Changes

1.1.1

Patch Changes

1.1.0

Minor Changes

  • Add createRouteMatcher() helper function that allows you to protect multiple pages or API routes. (#5050) by @wobsoriano

    For protecting pages (in a global route middleware):

    // createRouteMatcher is automatically imported
    const isProtectedRoute = createRouteMatcher(['/dashboard(.*)', '/forum(.*)']);
    
    export default defineNuxtRouteMiddleware(to => {
      const { userId } = useAuth();
    
      if (!userId.value && isProtectedRoute(to)) {
        // Add custom logic to run before redirecting
        return navigateTo('/sign-in');
      }
    });

    For protecting API routes:

    import { clerkMiddleware, createRouteMatcher } from '@clerk/nuxt/server';
    
    // Unlike pages, you need to import `createRouteMatcher` from `@clerk/nuxt/server`
    const isProtectedRoute = createRouteMatcher(['/api/user(.*)', '/api/projects(.*)']);
    
    export default clerkMiddleware(event => {
      const { userId } = event.context.auth;
    
      if (!userId && isProtectedRoute(event)) {
        setResponseStatus(event, 401);
        return 'You are not authorized to access this resource.';
      }
    });

Patch Changes

1.0.13

Patch Changes

1.0.12

Patch Changes

1.0.11

Patch Changes

1.0.10

Patch Changes

1.0.9

Patch Changes

1.0.8

Patch Changes

1.0.7

Patch Changes

1.0.6

Patch Changes

1.0.5

Patch Changes

1.0.4

Patch Changes

1.0.3

Patch Changes

1.0.2

Patch Changes

1.0.1

Patch Changes

1.0.0

Major Changes

Patch Changes

0.1.5

Patch Changes

0.1.4

Patch Changes

0.1.3

Patch Changes

0.1.2

Patch Changes

0.1.1

Patch Changes

0.1.0

Minor Changes

  • Switching to use ^ for semver ranges of internal @clerk/ production dependencies. (#4664) by @jacekradko

Patch Changes

0.0.13

Patch Changes

0.0.12

Patch Changes

0.0.11

Patch Changes

0.0.10

Patch Changes

0.0.9

Patch Changes

0.0.8

Patch Changes

0.0.7

Patch Changes

0.0.6

Patch Changes

0.0.5

Patch Changes

0.0.4

Patch Changes

0.0.3

Patch Changes

0.0.2

Patch Changes

0.0.1

Patch Changes