Skip to content

Conversation

@wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented May 9, 2025

Description

This PR adds billing features to useAuth() composable and <Protect> component in Vue. A port of #5582 into Vue.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@vercel
Copy link

vercel bot commented May 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2025 2:12am

@changeset-bot
Copy link

changeset-bot bot commented May 9, 2025

🦋 Changeset detected

Latest commit: 02d0e42

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clerk/vue Minor
@clerk/nuxt Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wobsoriano wobsoriano requested a review from octoper May 9, 2025 02:04
@wobsoriano wobsoriano marked this pull request as ready for review May 9, 2025 02:12
Comment on lines +91 to +92
features: ((sessionClaims as JwtPayload | undefined)?.fea as string) || '',
plans: ((sessionClaims as JwtPayload | undefined)?.pla as string) || '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rob, can you verify that on the client we are grabbing features and plans from the session.lastActiveToken ? This is something that the we handle inside deriveState, I just don't recall if it a shared utility used by vue, or we need to explicitly handle it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll test, thanks! But yes we use a shared utility for createCheckAuthorization, resolveAuthState and deriveState:

import { deriveState } from '@clerk/shared/deriveState';
import { createCheckAuthorization, resolveAuthState } from '@clerk/shared/authorization';

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup confirmed we do get it there

Screenshot 2025-05-09 at 7 48 56 AM

@wobsoriano
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @wobsoriano - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.0.34-snapshot.v20250509140404
@clerk/astro 2.7.2-snapshot.v20250509140404
@clerk/backend 1.31.5-snapshot.v20250509140404
@clerk/chrome-extension 2.4.3-snapshot.v20250509140404
@clerk/clerk-js 5.65.0-snapshot.v20250509140404
@clerk/elements 0.23.25-snapshot.v20250509140404
@clerk/clerk-expo 2.11.3-snapshot.v20250509140404
@clerk/expo-passkeys 0.3.2-snapshot.v20250509140404
@clerk/express 1.4.17-snapshot.v20250509140404
@clerk/fastify 2.2.17-snapshot.v20250509140404
@clerk/localizations 3.15.2-snapshot.v20250509140404
@clerk/nextjs 6.19.2-snapshot.v20250509140404
@clerk/nuxt 1.6.3-snapshot.v20250509140404
@clerk/clerk-react 5.31.2-snapshot.v20250509140404
@clerk/react-router 1.4.2-snapshot.v20250509140404
@clerk/remix 4.7.2-snapshot.v20250509140404
@clerk/shared 3.8.2-snapshot.v20250509140404
@clerk/tanstack-react-start 0.15.2-snapshot.v20250509140404
@clerk/testing 1.6.7-snapshot.v20250509140404
@clerk/themes 2.2.43-snapshot.v20250509140404
@clerk/types 4.58.0-snapshot.v20250509140404
@clerk/vue 1.8.0-snapshot.v20250509140404

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/[email protected] --save-exact

@clerk/astro

npm i @clerk/[email protected] --save-exact

@clerk/backend

npm i @clerk/[email protected] --save-exact

@clerk/chrome-extension

npm i @clerk/[email protected] --save-exact

@clerk/clerk-js

npm i @clerk/[email protected] --save-exact

@clerk/elements

npm i @clerk/[email protected] --save-exact

@clerk/clerk-expo

npm i @clerk/[email protected] --save-exact

@clerk/expo-passkeys

npm i @clerk/[email protected] --save-exact

@clerk/express

npm i @clerk/[email protected] --save-exact

@clerk/fastify

npm i @clerk/[email protected] --save-exact

@clerk/localizations

npm i @clerk/[email protected] --save-exact

@clerk/nextjs

npm i @clerk/[email protected] --save-exact

@clerk/nuxt

npm i @clerk/[email protected] --save-exact

@clerk/clerk-react

npm i @clerk/[email protected] --save-exact

@clerk/react-router

npm i @clerk/[email protected] --save-exact

@clerk/remix

npm i @clerk/[email protected] --save-exact

@clerk/shared

npm i @clerk/[email protected] --save-exact

@clerk/tanstack-react-start

npm i @clerk/[email protected] --save-exact

@clerk/testing

npm i @clerk/[email protected] --save-exact

@clerk/themes

npm i @clerk/[email protected] --save-exact

@clerk/types

npm i @clerk/[email protected] --save-exact

@clerk/vue

npm i @clerk/[email protected] --save-exact

@wobsoriano wobsoriano merged commit 4998547 into main May 9, 2025
34 checks passed
@wobsoriano wobsoriano deleted the rob/vue-billing-has-and-protect branch May 9, 2025 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants