-
Couldn't load subscription status.
- Fork 402
feat(clerk-js,clerk-react,types): Signal phone code support #6650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
22c95db
49f4669
6b97038
b1ac39a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@clerk/clerk-js': minor | ||
| '@clerk/clerk-react': minor | ||
| '@clerk/types': minor | ||
| --- | ||
|
|
||
| [Experimental] Signal phone code support |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,5 @@ | ||||||||||||||||
| import type { SetActiveNavigate } from './clerk'; | ||||||||||||||||
| import type { PhoneCodeChannel } from './phoneCodeChannel'; | ||||||||||||||||
| import type { SignInFirstFactor, SignInStatus } from './signInCommon'; | ||||||||||||||||
| import type { OAuthStrategy } from './strategies'; | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -28,6 +29,15 @@ export interface SignInFutureResetPasswordSubmitParams { | |||||||||||||||
| signOutOfOtherSessions?: boolean; | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| export interface SignInFuturePhoneCodeSendParams { | ||||||||||||||||
| phoneNumber?: string; | ||||||||||||||||
| channel?: PhoneCodeChannel; | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| export interface SignInFuturePhoneCodeVerifyParams { | ||||||||||||||||
| code: string; | ||||||||||||||||
| } | ||||||||||||||||
|
Comment on lines
+37
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add JSDoc for verify params. Document expected format and length constraints if any. +/** Parameters for verifying a phone verification code during sign-in. */
export interface SignInFuturePhoneCodeVerifyParams {
code: string;
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
|
|
||||||||||||||||
| export interface SignInFutureSSOParams { | ||||||||||||||||
| flow?: 'auto' | 'modal'; | ||||||||||||||||
| strategy: OAuthStrategy | 'saml' | 'enterprise_sso'; | ||||||||||||||||
|
|
@@ -56,6 +66,10 @@ export interface SignInFutureResource { | |||||||||||||||
| sendCode: (params: SignInFutureEmailCodeSendParams) => Promise<{ error: unknown }>; | ||||||||||||||||
| verifyCode: (params: SignInFutureEmailCodeVerifyParams) => Promise<{ error: unknown }>; | ||||||||||||||||
| }; | ||||||||||||||||
| phoneCode: { | ||||||||||||||||
| sendCode: (params: SignInFuturePhoneCodeSendParams) => Promise<{ error: unknown }>; | ||||||||||||||||
| verifyCode: (params: SignInFuturePhoneCodeVerifyParams) => Promise<{ error: unknown }>; | ||||||||||||||||
| }; | ||||||||||||||||
| resetPasswordEmailCode: { | ||||||||||||||||
| sendCode: () => Promise<{ error: unknown }>; | ||||||||||||||||
| verifyCode: (params: SignInFutureEmailCodeVerifyParams) => Promise<{ error: unknown }>; | ||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,5 @@ | ||||||||||||||||||||||||||||
| import type { SetActiveNavigate } from './clerk'; | ||||||||||||||||||||||||||||
| import type { PhoneCodeChannel } from './phoneCodeChannel'; | ||||||||||||||||||||||||||||
| import type { SignUpIdentificationField, SignUpStatus } from './signUpCommon'; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| export interface SignUpFutureCreateParams { | ||||||||||||||||||||||||||||
|
|
@@ -14,7 +15,16 @@ export interface SignUpFuturePasswordParams { | |||||||||||||||||||||||||||
| password: string; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| export interface SignUpFutureSSoParams { | ||||||||||||||||||||||||||||
| export interface SignUpFuturePhoneCodeSendParams { | ||||||||||||||||||||||||||||
| phoneNumber?: string; | ||||||||||||||||||||||||||||
| channel?: PhoneCodeChannel; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
Comment on lines
+18
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add JSDoc for new public params. Clarify when phoneNumber is required and default channel. +/**
+ * Parameters for sending a phone verification code during sign-up.
+ * - If a sign-up has not been created yet, `phoneNumber` is required.
+ * - `channel` defaults to `'sms'` if omitted.
+ */
export interface SignUpFuturePhoneCodeSendParams {
phoneNumber?: string;
channel?: PhoneCodeChannel;
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| export interface SignUpFuturePhoneCodeVerifyParams { | ||||||||||||||||||||||||||||
| code: string; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
Comment on lines
+23
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add JSDoc for verify params. Minimal doc for public type. +/** Parameters for verifying a phone verification code during sign-up. */
export interface SignUpFuturePhoneCodeVerifyParams {
code: string;
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| export interface SignUpFutureSSOParams { | ||||||||||||||||||||||||||||
| strategy: string; | ||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||
| * The URL to redirect to after the user has completed the SSO flow. | ||||||||||||||||||||||||||||
|
|
@@ -39,8 +49,10 @@ export interface SignUpFutureResource { | |||||||||||||||||||||||||||
| verifications: { | ||||||||||||||||||||||||||||
| sendEmailCode: () => Promise<{ error: unknown }>; | ||||||||||||||||||||||||||||
| verifyEmailCode: (params: SignUpFutureEmailCodeVerifyParams) => Promise<{ error: unknown }>; | ||||||||||||||||||||||||||||
| sendPhoneCode: (params: SignUpFuturePhoneCodeSendParams) => Promise<{ error: unknown }>; | ||||||||||||||||||||||||||||
| verifyPhoneCode: (params: SignUpFuturePhoneCodeVerifyParams) => Promise<{ error: unknown }>; | ||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||
| password: (params: SignUpFuturePasswordParams) => Promise<{ error: unknown }>; | ||||||||||||||||||||||||||||
| sso: (params: SignUpFutureSSoParams) => Promise<{ error: unknown }>; | ||||||||||||||||||||||||||||
| sso: (params: SignUpFutureSSOParams) => Promise<{ error: unknown }>; | ||||||||||||||||||||||||||||
| finalize: (params?: SignUpFutureFinalizeParams) => Promise<{ error: unknown }>; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add JSDoc for new public params.
Public types require JSDoc (see guidelines). Document when phoneNumber is required and the default channel.
Apply:
📝 Committable suggestion
🤖 Prompt for AI Agents