Skip to content

feat(nuxt): Add support for keyless mode#7844

Merged
wobsoriano merged 27 commits intomainfrom
rob/nuxt-keyless
Apr 9, 2026
Merged

feat(nuxt): Add support for keyless mode#7844
wobsoriano merged 27 commits intomainfrom
rob/nuxt-keyless

Conversation

@wobsoriano
Copy link
Copy Markdown
Member

@wobsoriano wobsoriano commented Feb 13, 2026

Description

Last SDK to have keyless but not the least 😄

Add keyless mode support to the Nuxt SDK, allowing developers to use Clerk without manually configuring API keys during development.

Also simplifies the keyless service initialization in @clerk/astro and @clerk/react-router by replacing the async promise-based pattern with a simpler lazy singleton (consistent with other SDKs like Next.js).

Changes

  • @clerk/nuxt: Add keyless mode (server middleware, plugin, feature flags, file storage)
  • @clerk/nuxt: Move apiUrl/apiVersion to private runtime config (server-only, matching Next.js)
  • @clerk/astro: Simplify keyless service initialization
  • @clerk/react-router: Simplify keyless service initialization
  • Integration tests: Add Nuxt keyless E2E tests, bump template to Nuxt 4.4.2

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:

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 13, 2026

🦋 Changeset detected

Latest commit: c37d62c

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

This PR includes changesets to release 3 packages
Name Type
@clerk/nuxt Minor
@clerk/astro Patch
@clerk/react-router 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

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
clerk-js-sandbox Skipped Skipped Apr 9, 2026 6:48pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 13, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a keyless quickstart for Nuxt and a changeset declaring a minor release. Introduces Playwright integration tests for Nuxt keyless mode. Adds Nuxt server keyless modules: file storage, lazy-initialized service, utilities, middleware resolution, a ClerkKeylessContext type, and a feature-flag helper. Updates Nuxt plugin to pass keyless context. Simplifies keyless initialization in Astro and React Router packages to a synchronous lazy singleton and removes resetKeylessService. Updates Nuxt template dependency versions.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding keyless mode support for Nuxt. It is concise, specific, and directly reflects the primary objective of the pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Introduce Keyless quickstart for Nuxt, enabling use of the Clerk SDK without manual key setup.
@wobsoriano wobsoriano changed the title feat(nuxt): Add support for keyless mode feat(nuxt): [WIP] Add support for keyless mode Feb 13, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Feb 13, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7844

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7844

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7844

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7844

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7844

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7844

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@7844

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7844

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7844

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7844

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@7844

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7844

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7844

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7844

@clerk/react

npm i https://pkg.pr.new/@clerk/react@7844

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7844

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7844

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7844

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7844

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@7844

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7844

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7844

commit: c37d62c

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@packages/astro/src/server/keyless/index.ts`:
- Around line 10-14: The keyless() factory unconditionally calls
createFileStorage(), which imports Node-only modules and crashes in edge
runtimes; add a runtime Node check at the start of keyless() (e.g., verify
typeof process !== 'undefined' && process.versions?.node) and if Node is not
available throw a clear error explaining that keyless storage requires a Node
runtime, so createFileStorage() is never invoked in non-Node environments; keep
references to keyless(), keylessServiceInstance, createFileStorage(),
resolveKeysWithKeylessFallback(), and canUseKeyless when making this change.

In `@packages/nuxt/src/runtime/server/keyless/index.ts`:
- Around line 7-39: The current module-level singleton keylessServiceInstance
closes over the first request's event causing stale request context; change to
cache only the storage (e.g., createFileStorage) at module scope and instantiate
createKeylessService per request inside the keyless(event) function so that api
methods call clerkClient(event) with the current H3Event; specifically, keep a
cached storage variable (instead of keylessServiceInstance), and in
keyless(event) call createKeylessService({ storage: cachedStorage, api: {
createAccountlessApplication: async (headers?) => clerkClient(event)...,
completeOnboarding: async (headers?) => clerkClient(event)... }, framework:
'nuxt' }) so no module-level closure captures the first event.

The Nitro build failed because clerkMiddleware.js imports from
../utils/feature-flags and ./keyless/utils, but those directories
were not included as tsup entry points, so they were missing from dist/.
Nuxt 4.1.2 has transitive dependency hoisting issues with npm install
(used by pkglab), causing all nuxt dev instances to crash with missing
packages like @clack/prompts, defu, and @jridgewell/trace-mapping.
These are server-only values matching how Next.js handles them
(process.env.CLERK_API_URL, process.env.CLERK_API_VERSION).
Now overridable via NUXT_CLERK_API_URL and NUXT_CLERK_API_VERSION.
…_API_URL

Keep apiUrl/apiVersion in public runtime config for backwards compat
but prefer private config (NUXT_CLERK_API_URL, NUXT_CLERK_API_VERSION)
and log a deprecation warning when the public variant is used. This
aligns with Next.js which reads CLERK_API_URL from process.env
(server-only).

This comment was marked as resolved.

@wobsoriano
Copy link
Copy Markdown
Member Author

!snapshot

@wobsoriano wobsoriano removed the core-3 label Apr 9, 2026
@wobsoriano
Copy link
Copy Markdown
Member Author

!snapshot

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

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

Package Version
@clerk/agent-toolkit 0.3.13-snapshot.v20260409161650
@clerk/astro 3.0.13-snapshot.v20260409161650
@clerk/backend 3.2.9-snapshot.v20260409161650
@clerk/chrome-extension 3.1.10-snapshot.v20260409161650
@clerk/clerk-js 6.6.1-snapshot.v20260409161650
@clerk/dev-cli 0.1.1-snapshot.v20260409161650
@clerk/expo 3.1.10-snapshot.v20260409161650
@clerk/expo-passkeys 1.0.11-snapshot.v20260409161650
@clerk/express 2.1.1-snapshot.v20260409161650
@clerk/fastify 3.1.11-snapshot.v20260409161650
@clerk/hono 0.1.11-snapshot.v20260409161650
@clerk/localizations 4.4.1-snapshot.v20260409161650
@clerk/msw 0.0.11-snapshot.v20260409161650
@clerk/nextjs 7.0.13-snapshot.v20260409161650
@clerk/nuxt 2.2.0-snapshot.v20260409161650
@clerk/react 6.2.2-snapshot.v20260409161650
@clerk/react-router 3.0.13-snapshot.v20260409161650
@clerk/shared 4.6.1-snapshot.v20260409161650
@clerk/tanstack-react-start 1.0.13-snapshot.v20260409161650
@clerk/testing 2.0.13-snapshot.v20260409161650
@clerk/ui 1.5.1-snapshot.v20260409161650
@clerk/upgrade 2.0.3-snapshot.v20260409161650
@clerk/vue 2.0.12-snapshot.v20260409161650

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

npm i @clerk/agent-toolkit@0.3.13-snapshot.v20260409161650 --save-exact

@clerk/astro

npm i @clerk/astro@3.0.13-snapshot.v20260409161650 --save-exact

@clerk/backend

npm i @clerk/backend@3.2.9-snapshot.v20260409161650 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@3.1.10-snapshot.v20260409161650 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@6.6.1-snapshot.v20260409161650 --save-exact

@clerk/dev-cli

npm i @clerk/dev-cli@0.1.1-snapshot.v20260409161650 --save-exact

@clerk/expo

npm i @clerk/expo@3.1.10-snapshot.v20260409161650 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@1.0.11-snapshot.v20260409161650 --save-exact

@clerk/express

npm i @clerk/express@2.1.1-snapshot.v20260409161650 --save-exact

@clerk/fastify

npm i @clerk/fastify@3.1.11-snapshot.v20260409161650 --save-exact

@clerk/hono

npm i @clerk/hono@0.1.11-snapshot.v20260409161650 --save-exact

@clerk/localizations

npm i @clerk/localizations@4.4.1-snapshot.v20260409161650 --save-exact

@clerk/msw

npm i @clerk/msw@0.0.11-snapshot.v20260409161650 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@7.0.13-snapshot.v20260409161650 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@2.2.0-snapshot.v20260409161650 --save-exact

@clerk/react

npm i @clerk/react@6.2.2-snapshot.v20260409161650 --save-exact

@clerk/react-router

npm i @clerk/react-router@3.0.13-snapshot.v20260409161650 --save-exact

@clerk/shared

npm i @clerk/shared@4.6.1-snapshot.v20260409161650 --save-exact

@clerk/tanstack-react-start

npm i @clerk/tanstack-react-start@1.0.13-snapshot.v20260409161650 --save-exact

@clerk/testing

npm i @clerk/testing@2.0.13-snapshot.v20260409161650 --save-exact

@clerk/ui

npm i @clerk/ui@1.5.1-snapshot.v20260409161650 --save-exact

@clerk/upgrade

npm i @clerk/upgrade@2.0.3-snapshot.v20260409161650 --save-exact

@clerk/vue

npm i @clerk/vue@2.0.12-snapshot.v20260409161650 --save-exact

@tmilewski tmilewski self-requested a review April 9, 2026 20:55
@wobsoriano wobsoriano merged commit 68d1d8d into main Apr 9, 2026
42 checks passed
@wobsoriano wobsoriano deleted the rob/nuxt-keyless branch April 9, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants