Skip to content

Conversation

dstaley
Copy link
Member

@dstaley dstaley commented Sep 30, 2025

Description

This PR adds additional properties to our Signal-based SignIn/SignUp resources, bringing them to parity with the existing API.

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

    • SignIn now exposes id, identifier, createdSessionId, userData, supportedFirstFactors, supportedSecondFactors, and secondFactorVerification.
    • SignUp now exposes id, required/optional/missing fields, username, profile/contact fields, hasPassword, unsafeMetadata, createdSessionId/createdUserId, abandonAt, and legalAcceptedAt.
    • React state proxies surface the same SignIn/SignUp properties with safe defaults.
  • Chores

    • Minor releases prepared for core packages.
    • Experimental: added support for additional properties in SignIn/SignUp signals.

Copy link

changeset-bot bot commented Sep 30, 2025

🦋 Changeset detected

Latest commit: 70b0710

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

This PR includes changesets to release 22 packages
Name Type
@clerk/clerk-js Minor
@clerk/clerk-react Minor
@clerk/types Minor
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/elements Patch
@clerk/nextjs Patch
@clerk/react-router Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/localizations Patch
@clerk/nuxt Patch
@clerk/shared Patch
@clerk/testing Patch
@clerk/themes 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

Copy link

vercel bot commented Sep 30, 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 Sep 30, 2025 11:15pm

Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

Walkthrough

Adds many read-only getters to SignInFuture and SignUpFuture mirroring underlying resources, expands sign-in/sign-up type interfaces (including second-factor data), updates React StateProxy to expose these properties with safe defaults, and adds a changeset declaring minor package bumps and an experimental property support note.

Changes

Cohort / File(s) Summary
Changeset
.changeset/weak-deer-tie.md
Adds a changeset declaring minor version bumps for @clerk/clerk-js, @clerk/clerk-react, and @clerk/types; notes experimental support for additional properties to Signal SignIn/SignUp.
Core resources (Futures)
packages/clerk-js/src/core/resources/SignIn.ts, packages/clerk-js/src/core/resources/SignUp.ts
Added numerous read-only getters on SignInFuture and SignUpFuture that proxy identifiers, metadata, and factor info to underlying resources; replaced availableStrategies with supportedFirstFactors; added supportedSecondFactors, secondFactorVerification, and other identifier/session/user accessors.
React state proxies
packages/react/src/stateProxy.ts
Exposed new signIn and signUp getters via gateProperty with safe defaults and guarded internals when Clerk is not loaded (SSR); preserved existing methods and status behavior.
Public types
packages/types/src/signInFuture.ts, packages/types/src/signUpFuture.ts
Expanded SignInFutureResource and SignUpFutureResource interfaces with fields such as id, identifiers, createdSessionId/createdUserId, userData/unsafeMetadata, required/optional/missing fields, supportedFirstFactors/supportedSecondFactors, and secondFactorVerification; updated imports and renamed availableStrategiessupportedFirstFactors.
Example integration
integration/templates/.../src/routes/SignIn.tsx
Replaced usage of signIn.availableStrategies with signIn.supportedFirstFactors in the first-factor selection UI rendering.

Sequence Diagram(s)

sequenceDiagram
  participant UI as App/Components
  participant SP as StateProxy (React)
  participant F as Future (SignIn/SignUp)
  participant R as Underlying Resource

  UI->>SP: access getter (e.g., supportedFirstFactors, id)
  alt Clerk loaded (browser)
    SP->>F: gateProperty -> invoke getter
    F->>R: read corresponding resource property
    R-->>F: value
    F-->>SP: value
    SP-->>UI: value
  else Not loaded / SSR
    SP-->>UI: return default value or guarded stub (throws on guarded internals)
  end

  note over F,R: New getters mirror resource fields including second-factor data and metadata
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit taps the keyboard light, 🐇
New getters bloom in morning bright.
First and second factors, lined in rows,
Futures echo what the resource knows.
Hop on—these fields now plainly show! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The title correctly indicates a feature addition across multiple packages but is vague about what “additional props” refers to, failing to specify the Signal SignIn/SignUp properties that comprise the main change. Consider renaming to clearly reference the specific feature, such as “feat: Expose additional Signal SignIn/SignUp properties in clerk-js, clerk-react, and types,” to concisely convey the core change.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ds.feat/signals-properties

📜 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 b0cb1c9 and 70b0710.

📒 Files selected for processing (1)
  • integration/templates/custom-flows-react-vite/src/routes/SignIn.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{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:

  • integration/templates/custom-flows-react-vite/src/routes/SignIn.tsx
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

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

Use Prettier for consistent code formatting

Files:

  • integration/templates/custom-flows-react-vite/src/routes/SignIn.tsx
**/*.{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:

  • integration/templates/custom-flows-react-vite/src/routes/SignIn.tsx
**/*.{jsx,tsx}

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

**/*.{jsx,tsx}: Use error boundaries in React components
Minimize re-renders in React components

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components: UserProfile, NavigationMenu
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Use useState for simple state management
Use useReducer for complex state logic
Implement proper state initialization
Use proper state updates with callbacks
Implement proper state cleanup
Use Context API for theme/authentication
Implement proper state selectors
Use proper state normalization
Implement proper state persistence
Use React.memo for expensive components
Implement proper useCallback for handlers
Use proper useMemo for expensive computations
Implement proper virtualization for lists
Use proper code splitting with React.lazy
Implement proper cleanup in useEffect
Use proper refs for DOM access
Implement proper event listener cleanup
Use proper abort controllers for fetch
Implement proper subscription cleanup
Use proper HTML elements
Implement proper ARIA attributes
Use proper heading hierarchy
Implement proper form labels
Use proper button types
Implement proper focus management
Use proper keyboard shortcuts
Implement proper tab order
Use proper skip links
Implement proper focus traps
Implement proper error boundaries
Use proper error logging
Implement proper error recovery
Use proper error messages
Implement proper error fallbacks
Use proper form validation
Implement proper error states
Use proper error messages
Implement proper form submission
Use proper form reset
Use proper component naming
Implement proper file naming
Use proper prop naming
Implement proper...

Files:

  • integration/templates/custom-flows-react-vite/src/routes/SignIn.tsx
integration/**

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

Framework integration templates and E2E tests should be placed under the integration/ directory

Files:

  • integration/templates/custom-flows-react-vite/src/routes/SignIn.tsx
integration/**/*

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

End-to-end tests and integration templates must be located in the 'integration/' directory.

Files:

  • integration/templates/custom-flows-react-vite/src/routes/SignIn.tsx
**/*.{js,ts,tsx,jsx}

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

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

Files:

  • integration/templates/custom-flows-react-vite/src/routes/SignIn.tsx
**/*.tsx

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

**/*.tsx: Use proper type definitions for props and state
Leverage TypeScript's type inference where possible
Use proper event types for handlers
Implement proper generic types for reusable components
Use proper type guards for conditional rendering

Files:

  • integration/templates/custom-flows-react-vite/src/routes/SignIn.tsx
⏰ 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). (28)
  • GitHub Check: Integration Tests (tanstack-react-router, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
  • GitHub Check: Static analysis
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
integration/templates/custom-flows-react-vite/src/routes/SignIn.tsx (1)

107-118: LGTM! Property rename aligns with the new SignInFuture API.

The change from availableStrategies to supportedFirstFactors correctly reflects the updated API surface. The destructuring pattern { strategy } in the filter and map operations confirms that the array structure remains consistent, and the filtering logic for reset_password_email_code continues to work as expected.


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

@dstaley dstaley changed the title feat(clerk-js,clerk-react,types): Add support for additional properti… feat(clerk-js,clerk-react,types): Add support for additional props Sep 30, 2025
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: 4

📜 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 83b4cff and b0cb1c9.

📒 Files selected for processing (6)
  • .changeset/weak-deer-tie.md (1 hunks)
  • packages/clerk-js/src/core/resources/SignIn.ts (2 hunks)
  • packages/clerk-js/src/core/resources/SignUp.ts (1 hunks)
  • packages/react/src/stateProxy.ts (2 hunks)
  • packages/types/src/signInFuture.ts (3 hunks)
  • packages/types/src/signUpFuture.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{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/SignUp.ts
  • packages/react/src/stateProxy.ts
  • packages/clerk-js/src/core/resources/SignIn.ts
  • packages/types/src/signUpFuture.ts
  • packages/types/src/signInFuture.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/SignUp.ts
  • packages/react/src/stateProxy.ts
  • packages/clerk-js/src/core/resources/SignIn.ts
  • packages/types/src/signUpFuture.ts
  • packages/types/src/signInFuture.ts
packages/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/core/resources/SignUp.ts
  • packages/react/src/stateProxy.ts
  • packages/clerk-js/src/core/resources/SignIn.ts
  • packages/types/src/signUpFuture.ts
  • packages/types/src/signInFuture.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/SignUp.ts
  • packages/react/src/stateProxy.ts
  • packages/clerk-js/src/core/resources/SignIn.ts
  • packages/types/src/signUpFuture.ts
  • packages/types/src/signInFuture.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/SignUp.ts
  • packages/react/src/stateProxy.ts
  • packages/clerk-js/src/core/resources/SignIn.ts
  • packages/types/src/signUpFuture.ts
  • packages/types/src/signInFuture.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/SignUp.ts
  • packages/react/src/stateProxy.ts
  • packages/clerk-js/src/core/resources/SignIn.ts
  • packages/types/src/signUpFuture.ts
  • packages/types/src/signInFuture.ts
.changeset/**

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

Automated releases must use Changesets.

Files:

  • .changeset/weak-deer-tie.md
🧬 Code graph analysis (2)
packages/types/src/signUpFuture.ts (1)
packages/types/src/signUpCommon.ts (2)
  • SignUpStatus (25-25)
  • SignUpField (27-27)
packages/types/src/signInFuture.ts (2)
packages/types/src/signInCommon.ts (3)
  • SignInFirstFactor (74-85)
  • SignInSecondFactor (87-87)
  • UserData (89-94)
packages/types/src/verification.ts (1)
  • VerificationResource (7-20)
⏰ 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). (4)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
.changeset/weak-deer-tie.md (1)

1-7: LGTM! Changeset properly formatted.

The changeset correctly declares minor version bumps for the affected packages and appropriately flags this as an experimental feature.

packages/types/src/signInFuture.ts (1)

130-179: LGTM! Type definitions are well-documented.

The new fields are properly typed with appropriate JSDoc comments and readonly modifiers. The types align correctly with the imported definitions from signInCommon.ts.

packages/react/src/stateProxy.ts (1)

48-86: Good use of safe defaults with gateProperty.

The new getters consistently use gateProperty with appropriate fallback values, ensuring safe behavior when Clerk is not loaded or in non-browser contexts.

Also applies to: 149-196

packages/types/src/signUpFuture.ts (1)

74-135: LGTM! Comprehensive type definitions with proper documentation.

The new fields are well-documented with JSDoc comments and properly typed. The readonly modifiers are consistently applied, and the types align correctly with the imported definitions.

packages/clerk-js/src/core/resources/SignUp.ts (1)

554-621: Additional getters look solid.

They mirror the underlying SignUp resource fields 1:1, so the expanded SignUpFutureResource shape stays accurate and consumers now get parity with the main API surface.

Comment on lines +611 to +625
get id() {
return this.resource.id;
}

get identifier() {
return this.resource.identifier;
}

get createdSessionId() {
return this.resource.createdSessionId;
}

get userData() {
return this.resource.userData;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Add explicit return types and JSDoc comments for new public getters.

These new getters lack explicit return type annotations and JSDoc documentation. Per coding guidelines, public APIs should have explicit return types and comprehensive JSDoc comments.

Apply this diff to add return types and documentation:

+  /**
+   * The unique identifier for the current sign-in attempt.
+   */
-  get id() {
+  get id(): string | undefined {
     return this.resource.id;
   }

+  /**
+   * The identifier for the current sign-in attempt.
+   */
-  get identifier() {
+  get identifier(): string | null {
     return this.resource.identifier;
   }

+  /**
+   * The created session ID for the current sign-in attempt.
+   */
-  get createdSessionId() {
+  get createdSessionId(): string | null {
     return this.resource.createdSessionId;
   }

+  /**
+   * The user data for the current sign-in attempt.
+   */
-  get userData() {
+  get userData(): UserData {
     return this.resource.userData;
   }

As per coding guidelines.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
get id() {
return this.resource.id;
}
get identifier() {
return this.resource.identifier;
}
get createdSessionId() {
return this.resource.createdSessionId;
}
get userData() {
return this.resource.userData;
}
/**
* The unique identifier for the current sign-in attempt.
*/
get id(): string | undefined {
return this.resource.id;
}
/**
* The identifier for the current sign-in attempt.
*/
get identifier(): string | null {
return this.resource.identifier;
}
/**
* The created session ID for the current sign-in attempt.
*/
get createdSessionId(): string | null {
return this.resource.createdSessionId;
}
/**
* The user data for the current sign-in attempt.
*/
get userData(): UserData {
return this.resource.userData;
}
🤖 Prompt for AI Agents
In packages/clerk-js/src/core/resources/SignIn.ts around lines 611 to 625, the
four new public getters lack explicit return type annotations and JSDoc; update
each getter to declare its explicit return type (use the exact types from the
SignIn resource/interface—e.g., id: string | undefined, identifier: string |
undefined, createdSessionId: string | undefined, userData: Record<string,
unknown> | undefined—or the precise types defined on the SignIn resource) and
add a brief JSDoc block above each getter describing what the property
represents and its return type; reference the existing SignIn resource/interface
for exact type names and keep wording consistent with other resource getters.

Comment on lines +632 to +638
get supportedFirstFactors() {
return this.resource.supportedFirstFactors ?? [];
}

get supportedSecondFactors() {
return this.resource.supportedSecondFactors ?? [];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Add explicit return type and JSDoc for supportedSecondFactors getter.

The new supportedSecondFactors getter is missing an explicit return type annotation and JSDoc documentation.

Apply this diff:

-  get supportedFirstFactors() {
+  get supportedFirstFactors(): SignInFirstFactor[] {
     return this.resource.supportedFirstFactors ?? [];
   }

+  /**
+   * The list of second-factor strategies that are available for the current sign-in attempt.
+   */
-  get supportedSecondFactors() {
+  get supportedSecondFactors(): SignInSecondFactor[] {
     return this.resource.supportedSecondFactors ?? [];
   }

As per coding guidelines.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
get supportedFirstFactors() {
return this.resource.supportedFirstFactors ?? [];
}
get supportedSecondFactors() {
return this.resource.supportedSecondFactors ?? [];
}
get supportedFirstFactors(): SignInFirstFactor[] {
return this.resource.supportedFirstFactors ?? [];
}
/**
* The list of second-factor strategies that are available for the current sign-in attempt.
*/
get supportedSecondFactors(): SignInSecondFactor[] {
return this.resource.supportedSecondFactors ?? [];
}
🤖 Prompt for AI Agents
In packages/clerk-js/src/core/resources/SignIn.ts around lines 632 to 638, the
supportedSecondFactors getter lacks an explicit return type and JSDoc; add a
JSDoc block describing the getter and its return value and give the getter the
same explicit return type as supportedFirstFactors (e.g., the appropriate array
type used by supportedFirstFactors) so the signature becomes documented and
type-annotated consistently with supportedFirstFactors.

Comment on lines +660 to +662
get secondFactorVerification() {
return this.resource.secondFactorVerification;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Add explicit return type and JSDoc for secondFactorVerification getter.

Missing explicit return type and documentation for this public getter.

Apply this diff:

+  /**
+   * The second-factor verification for the current sign-in attempt.
+   */
-  get secondFactorVerification() {
+  get secondFactorVerification(): VerificationResource {
     return this.resource.secondFactorVerification;
   }

As per coding guidelines.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
get secondFactorVerification() {
return this.resource.secondFactorVerification;
}
/**
* The second-factor verification for the current sign-in attempt.
*/
get secondFactorVerification(): VerificationResource {
return this.resource.secondFactorVerification;
}
🤖 Prompt for AI Agents
In packages/clerk-js/src/core/resources/SignIn.ts around lines 660 to 662, the
public getter secondFactorVerification is missing an explicit return type and
JSDoc; add a JSDoc block above the getter describing its purpose and usage and
add an explicit return type that matches the type of
this.resource.secondFactorVerification (e.g., the existing
SecondFactorVerificationResource type or its optional variant) and include an
@returns tag describing the returned resource.

Comment on lines +57 to +76
get secondFactorVerification() {
return gateProperty(target, 'secondFactorVerification', {
status: null,
error: null,
expireAt: null,
externalVerificationRedirectURL: null,
nonce: null,
attempts: null,
message: null,
strategy: null,
verifiedAtClient: null,
verifiedFromTheSameClient: () => false,
__internal_toSnapshot: () => {
throw new Error('__internal_toSnapshot called before Clerk is loaded');
},
pathRoot: '',
reload: () => {
throw new Error('__internal_toSnapshot called before Clerk is loaded');
},
});
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix error messages in secondFactorVerification default object.

The error messages on lines 70 and 74 are incorrect. Line 70 throws for __internal_toSnapshot but line 74 throws the same message for reload.

Apply this diff:

            __internal_toSnapshot: () => {
              throw new Error('__internal_toSnapshot called before Clerk is loaded');
            },
            pathRoot: '',
            reload: () => {
-             throw new Error('__internal_toSnapshot called before Clerk is loaded');
+             throw new Error('reload called before Clerk is loaded');
            },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
get secondFactorVerification() {
return gateProperty(target, 'secondFactorVerification', {
status: null,
error: null,
expireAt: null,
externalVerificationRedirectURL: null,
nonce: null,
attempts: null,
message: null,
strategy: null,
verifiedAtClient: null,
verifiedFromTheSameClient: () => false,
__internal_toSnapshot: () => {
throw new Error('__internal_toSnapshot called before Clerk is loaded');
},
pathRoot: '',
reload: () => {
throw new Error('__internal_toSnapshot called before Clerk is loaded');
},
});
get secondFactorVerification() {
return gateProperty(target, 'secondFactorVerification', {
status: null,
error: null,
expireAt: null,
externalVerificationRedirectURL: null,
nonce: null,
attempts: null,
message: null,
strategy: null,
verifiedAtClient: null,
verifiedFromTheSameClient: () => false,
__internal_toSnapshot: () => {
throw new Error('__internal_toSnapshot called before Clerk is loaded');
},
pathRoot: '',
reload: () => {
throw new Error('reload called before Clerk is loaded');
},
});
}
🤖 Prompt for AI Agents
In packages/react/src/stateProxy.ts around lines 57 to 76, the default
secondFactorVerification object uses the same error message for both
__internal_toSnapshot and reload; update the reload throw to a descriptive
message (e.g., throw new Error('reload called before Clerk is loaded')) instead
of duplicating the __internal_toSnapshot message so each function reports the
correct error context.

Copy link

pkg-pr-new bot commented Sep 30, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: 70b0710

@dstaley dstaley merged commit a1f6714 into main Oct 6, 2025
43 checks passed
@dstaley dstaley deleted the ds.feat/signals-properties branch October 6, 2025 14: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.

3 participants