Skip to content

Conversation

guilherme6191
Copy link
Member

@guilherme6191 guilherme6191 commented Oct 16, 2025

Description

This PR adds auto detection of browser locale (navigator.language) and sends that to sign-in flow. This is similar to the behavior implemented for the sign-up (#6915), but does not expose locale in the API to reduce noise/complexity at sign-in for now.

For extra context: this is a change where we'll be storing users preferred language from the browser, and C1s can update via BAPI (later on via dashboard and AIOs) so we can send localized templates. The whole feature is behind a FF and we're rolling out only for Spark (new customer implementing Clerk).

https://linear.app/clerk/issue/USER-3712/detect-and-send-locale-in-sign-ins-js-lib

Note: needs https://github.com/clerk/clerk_go/pull/14182 released

Checklist

Type of change

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

Summary by CodeRabbit

  • New Features

    • Sign-in flow now detects and automatically sends the browser locale to improve localization during authentication.
  • Tests

    • Added tests verifying locale is included when present and omitted when absent.
    • Test setup updated for a predictable navigator.language and centralized mock/cleanup to stabilize sign-in test suites.

Copy link

changeset-bot bot commented Oct 16, 2025

🦋 Changeset detected

Latest commit: c781372

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

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo 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

Copy link

vercel bot commented Oct 16, 2025

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

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Oct 17, 2025 4:21pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

Copy link
Contributor

coderabbitai bot commented Oct 16, 2025

Walkthrough

Adds browser locale detection to the @clerk/clerk-js sign-in flow by calling getBrowserLocale() and conditionally including the locale in sign-in request bodies; if no locale is detected, requests omit the locale.

Changes

Cohort / File(s) Summary
Changeset documentation
​.changeset/quick-kings-rescue.md
Patch release entry noting addition of browser locale to sign-in flow.
Sign-in implementation
packages/clerk-js/src/core/resources/SignIn.ts
Computes locale via getBrowserLocale() and conditionally injects it into request bodies for SignIn.create, SignInFuture._create, and SignInFuture.password.
Sign-in tests
packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
Adds tests asserting locale is included when navigator.language is set and excluded when empty; centralizes mock setup via beforeAll and resets mocks/unstubs in afterEach.
Test environment setup
packages/clerk-js/vitest.setup.mts
Sets window.navigator.language to an empty string ('') in the Vitest/jsdom setup.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Browser
    participant SignIn
    participant Server

    User->>SignIn: start sign-in (create / password)
    SignIn->>Browser: getBrowserLocale()
    alt locale detected
        Browser-->>SignIn: "en-US" (example)
        Note right of SignIn: include `locale` in request body
    else locale not detected
        Browser-->>SignIn: "" / undefined
        Note right of SignIn: omit `locale` from request body
    end
    SignIn->>Server: POST /sign-in (body with/without locale)
    Server-->>SignIn: response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I sniffed the browser breeze and found a clue,
I tucked the locale in the sign-in stew,
If silence whispered, I hopped away light,
The flow went on, tidy and right,
A tiny hop toward doing it true.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "feat(clerk-js): Detect locale from browser and send it to FAPI if exists during sign-in (i18n)" is highly specific and accurately summarizes the main changes in the PR. It clearly communicates that the feature detects browser locale and sends it during sign-in, which aligns with all modifications across SignIn.ts, tests, and test setup. The title is concise, follows conventional commit formatting, and avoids vague terminology, making it immediately clear to reviewers what the core change accomplishes.
Linked Issues Check ✅ Passed The code changes fully satisfy the three primary objectives from USER-3712: locale detection from the browser is implemented via getBrowserLocale() [USER-3712], sending to the FAPI sign-in flow is accomplished by merging locale into the request body in SignIn.ts [USER-3712], and conditional sending without error handling is correctly implemented by only including locale when it is truthy [USER-3712]. The test suite validates both conditions—inclusion when navigator.language is set and exclusion when empty—confirming the implementation matches the requirements.
Out of Scope Changes Check ✅ Passed All changes in the pull request are directly related to the USER-3712 objective of detecting and sending browser locale during sign-in. The modifications to SignIn.ts implement the core feature, the test additions in SignIn.test.ts validate the locale detection and transmission, the changeset documents the new capability, and the vitest setup change provides test infrastructure support by mocking navigator.language. No unrelated refactoring, cleanup, or out-of-scope modifications are present.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch guilherme/user-3712-detect-and-send-locale-in-sign-ins-js-lib

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f500017 and c781372.

📒 Files selected for processing (1)
  • packages/clerk-js/src/core/resources/SignIn.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/clerk-js/src/core/resources/SignIn.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

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

Copy link

pkg-pr-new bot commented Oct 16, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@7011

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@7011

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@7011

@clerk/types

npm i https://pkg.pr.new/@clerk/types@7011

@clerk/upgrade

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

@clerk/vue

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

commit: c781372

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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 160dc93 and 231a103.

📒 Files selected for processing (4)
  • .changeset/quick-kings-rescue.md (1 hunks)
  • packages/clerk-js/src/core/resources/SignIn.ts (4 hunks)
  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts (1 hunks)
  • packages/clerk-js/vitest.setup.mts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
.changeset/**

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/quick-kings-rescue.md
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
  • packages/clerk-js/src/core/resources/SignIn.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
  • packages/clerk-js/src/core/resources/SignIn.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
  • packages/clerk-js/src/core/resources/SignIn.ts
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
  • packages/clerk-js/src/core/resources/SignIn.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
  • packages/clerk-js/src/core/resources/SignIn.ts
packages/**/*.{test,spec}.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Unit tests should use Jest or Vitest as the test runner.

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
packages/{clerk-js,elements,themes}/**/*.{test,spec}.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Visual regression testing should be performed for UI components.

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
  • packages/clerk-js/src/core/resources/SignIn.ts
**/__tests__/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/__tests__/**/*.{ts,tsx}: Create type-safe test builders/factories
Use branded types for test isolation
Implement proper mock types that match interfaces

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
🧬 Code graph analysis (2)
packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts (1)
packages/clerk-js/src/core/resources/SignIn.ts (1)
  • SignIn (99-556)
packages/clerk-js/src/core/resources/SignIn.ts (2)
packages/clerk-js/src/core/resources/SignUp.ts (1)
  • locale (650-652)
packages/clerk-js/src/utils/locale.ts (1)
  • getBrowserLocale (11-28)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan


throw new Error('Unexpected call to BaseResource._fetch');
beforeAll(() => {
const signInCreatedJSON = {
Copy link
Member Author

Choose a reason for hiding this comment

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

with new tests and mocks, this was source of failing tests. So I just added moved the into the beforeAll function so we can have more control over order and scope

@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
Copy link
Member Author

Choose a reason for hiding this comment

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

since there is no change (even backwards compatible) to the sdk api for users, I think we have a patch here -- open to make it a minor as well

@guilherme6191 guilherme6191 changed the title feat(i18n): at sign-in, detect locale from browser and send it to FAPI if exists feat(i18n): At sign-in, detect locale from browser and send it to FAPI if exists Oct 16, 2025
@guilherme6191 guilherme6191 changed the title feat(i18n): At sign-in, detect locale from browser and send it to FAPI if exists feat(i18n): Detect locale from browser and send it to FAPI if exists during sign-in Oct 16, 2025
@guilherme6191
Copy link
Member Author

Note: I've labeled to do not merge for now as we need FAPI changes released - integration tests should fail because of that too.

return this._basePost({
path: this.pathRoot,
body: params,
body: { ...params, ...(locale ? { locale } : {}) },
Copy link
Member

Choose a reason for hiding this comment

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

I believe this order should be reversed, as we want to prefer the provided locale from params over the auto-detected one.

Copy link
Member Author

@guilherme6191 guilherme6191 Oct 16, 2025

Choose a reason for hiding this comment

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

@dstaley, good call. I'm updating the code as it's applicable in case we expose locale as a param as well, which is not the case now.

For now we're not exposing the locale to the sign-in API. We initially think that could add complexity for users and we'll revisit the DX if we expose it. It's available in sign-up as that's more appropriate there. Let me know if that makes sense.

FYI the functionality is going to be behind a FF too.

'@clerk/clerk-js': patch
---

Add browser locale to sign-in flow
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Add browser locale to sign-in flow
Add support for automatically sending the browser locale during the sign-in flow

@guilherme6191 guilherme6191 changed the title feat(i18n): Detect locale from browser and send it to FAPI if exists during sign-in feat(clerk-js, i18n): Detect locale from browser and send it to FAPI if exists during sign-in Oct 16, 2025
@guilherme6191 guilherme6191 requested a review from dstaley October 16, 2025 21:13
@guilherme6191 guilherme6191 force-pushed the guilherme/user-3712-detect-and-send-locale-in-sign-ins-js-lib branch from 7e714c7 to f500017 Compare October 17, 2025 14:01
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: 0

🧹 Nitpick comments (1)
packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts (1)

63-93: Consider adding cleanup for consistency.

The centralized mock setup in beforeAll is a good refactor. However, for consistency with the signIn.create suite and to prevent potential cross-suite pollution, consider adding an afterAll or afterEach to clear mocks after the SignInFuture tests complete.

     beforeAll(() => {
       ...
     });
+
+    afterAll(() => {
+      vi.clearAllMocks();
+    });

     it('should select correct first factor by email address', async () => {
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7e714c7 and f500017.

📒 Files selected for processing (4)
  • .changeset/quick-kings-rescue.md (1 hunks)
  • packages/clerk-js/src/core/resources/SignIn.ts (4 hunks)
  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts (1 hunks)
  • packages/clerk-js/vitest.setup.mts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • .changeset/quick-kings-rescue.md
  • packages/clerk-js/vitest.setup.mts
  • packages/clerk-js/src/core/resources/SignIn.ts
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
packages/**/*.{test,spec}.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Unit tests should use Jest or Vitest as the test runner.

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
packages/{clerk-js,elements,themes}/**/*.{test,spec}.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Visual regression testing should be performed for UI components.

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
**/__tests__/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/__tests__/**/*.{ts,tsx}: Create type-safe test builders/factories
Use branded types for test isolation
Implement proper mock types that match interfaces

Files:

  • packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts
🧬 Code graph analysis (1)
packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts (1)
packages/clerk-js/src/core/resources/SignIn.ts (1)
  • SignIn (99-556)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (27)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Static analysis
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
packages/clerk-js/src/core/resources/__tests__/SignIn.test.ts (1)

1-1: LGTM! Well-structured test suite for locale behavior.

The new test suite properly validates that:

  • Locale is included in the request body when navigator.language is set (test 1)
  • Locale is excluded when navigator.language is empty (test 2)

The cleanup in afterEach correctly addresses the past review concern about stubbed globals persisting across tests.

Also applies to: 7-59

@guilherme6191 guilherme6191 changed the title feat(clerk-js, i18n): Detect locale from browser and send it to FAPI if exists during sign-in feat(clerk-js): Detect locale from browser and send it to FAPI if exists during sign-in (i18n) Oct 17, 2025
@guilherme6191 guilherme6191 merged commit 6503405 into main Oct 17, 2025
41 checks passed
@guilherme6191 guilherme6191 deleted the guilherme/user-3712-detect-and-send-locale-in-sign-ins-js-lib branch October 17, 2025 16:34
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.

4 participants