Uh oh!
There was an error while loading. Please reload this page.
fix(nuxt): derive apiUrl from publishable key like other SDKs - #8208
Conversation
Instead of hardcoding 'https://api.clerk.com', use apiUrlFromPublishableKey() to auto-derive the backend API URL from the publishable key's FAPI domain suffix. This aligns @clerk/nuxt with @clerk/nextjs, @clerk/astro, and other Clerk SDKs, so staging publishable keys automatically route to the correct API endpoint.
🦋 Changeset detectedLatest commit: 2e681ca The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
@clerk/agent-toolkit@clerk/astro@clerk/backend@clerk/chrome-extension@clerk/clerk-js@clerk/dev-cli@clerk/expo@clerk/expo-passkeys@clerk/express@clerk/fastify@clerk/hono@clerk/localizations@clerk/nextjs@clerk/nuxt@clerk/react@clerk/react-router@clerk/shared@clerk/tanstack-react-start@clerk/testing@clerk/ui@clerk/upgrade@clerk/vuecommit: |
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRuntime config default for 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Description
@clerk/nuxthardcodesapiUrl: 'https://api.clerk.com'in its runtime config defaults. Every other Clerk SDK (@clerk/nextjs,@clerk/astro,@clerk/react-router,@clerk/tanstack-react-start) usesapiUrlFromPublishableKey()to auto-derive the backend API URL from the publishable key's FAPI domain suffix. This means staging publishable keys (with.accountsstage.dev) automatically route tohttps://api.clerkstage.devin every SDK except Nuxt, forcing Nuxt users to manually setNUXT_PUBLIC_CLERK_API_URL.This PR changes the
apiUrldefault to an empty string and adds theapiUrlFromPublishableKey()fallback inclerkClient.ts, matching the pattern used by@clerk/nextjsinpackages/nextjs/src/server/constants.ts.https://api.clerkstage.devhttps://api.clerk.comNUXT_PUBLIC_CLERK_API_URLstill takes priorityChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
apiUrlis now automatically derived from the publishable key, reducing manual configuration.Tests