Skip to content

chore(ui,shared,localizations): Improve error handling when creating API keys#8056

Open
wobsoriano wants to merge 6 commits intomainfrom
rob/api-keys-usage-exceeded
Open

chore(ui,shared,localizations): Improve error handling when creating API keys#8056
wobsoriano wants to merge 6 commits intomainfrom
rob/api-keys-usage-exceeded

Conversation

@wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented Mar 12, 2026

Description

  • Handles 403 (usage exceeded) and 409 (duplicate name) errors when creating API keys in the <APIKeys /> component
  • Add localized error messages for both cases

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:

Summary by CodeRabbit

  • New Features

    • Enhanced API key creation error handling with localized messages for duplicate names and usage limits.
    • Added Chrome extension support with Vite template and testing infrastructure.
    • Introduced staging environment support for integration testing.
  • Bug Fixes

    • Fixed token cache refresh timer cleanup to prevent accumulation across overwrites.
    • Improved satellite auto-sync defaulting behavior and request handling.
    • Corrected multiple localization strings across languages.
  • Documentation

    • Updated integration testing guides for staging environment configuration.

@vercel
Copy link

vercel bot commented Mar 12, 2026

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Mar 26, 2026 2:27pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Mar 12, 2026

🦋 Changeset detected

Latest commit: 1726683

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

This PR includes changesets to release 21 packages
Name Type
@clerk/localizations Patch
@clerk/shared Patch
@clerk/ui Patch
@clerk/react Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/expo-passkeys Patch
@clerk/expo Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/hono Patch
@clerk/msw Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/vue 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 changed the title chore(ui,shared,localization): Improve error handling when creating API keys chore(ui,shared,localizations): Improve error handling when creating API keys Mar 12, 2026
@wobsoriano wobsoriano marked this pull request as ready for review March 12, 2026 20:56
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 12, 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

This pull request introduces API key error handling improvements, adds Chrome extension integration testing support, implements staging instance testing capabilities, reorganizes machine authentication tests, and performs widespread package version updates across the monorepo. Changes include new localization strings for API key conflicts and usage limits, updates to multiple frontend packages with bug fixes and feature improvements, enhancements to Clerk JS core functionality including session minting and token refresh behavior, updates to GitHub Actions workflows and Turbo configuration for CI/CD, and reorganization of integration tests to support both production and staging environments with new test fixtures and helpers.

Possibly related PRs

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 12, 2026

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 1726683

Copy link
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ui/src/components/APIKeys/APIKeys.tsx`:
- Around line 123-126: The 403 branch in APIKeys.tsx currently maps all
forbidden responses to the "usage exceeded" message; update the handler in the
block that checks err.status === 403 to inspect the backend error code (e.g.,
err?.data?.code or err?.body?.code) and only call
card.setError(t(localizationKeys('unstable__errors.api_key_usage_exceeded')))
when that code equals "token_quota_exceeded"; for other 403s call a generic
forbidden message (or a fallback like t(localizationKeys('errors.forbidden')))
and ensure err is safely null-checked before reading the code to avoid runtime
errors.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0715d523-4e31-4d5b-8073-facaf725b8f5

📥 Commits

Reviewing files that changed from the base of the PR and between a5aa803 and 5b7dfa9.

📒 Files selected for processing (5)
  • .changeset/cyan-elephants-roll.md
  • integration/tests/machine-auth/component.test.ts
  • packages/localizations/src/en-US.ts
  • packages/shared/src/types/localization.ts
  • packages/ui/src/components/APIKeys/APIKeys.tsx

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.

2 participants