Skip to content

Commit 1c97fd0

Browse files
authored
feat(backend): Add notifyPrimaryEmailAddressChanged to updateUser params (#6023)
1 parent 5421421 commit 1c97fd0

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.changeset/real-regions-bake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/backend': patch
3+
---
4+
5+
Add `notifyPrimaryEmailAddressChanged` to `client.users.updateUser(...)`

packages/backend/src/api/endpoints/UserApi.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,70 @@ type CreateUserParams = {
9292
(UserPasswordHashingParams | object);
9393

9494
type UpdateUserParams = {
95+
/** The first name to assign to the user. */
9596
firstName?: string;
97+
98+
/** The last name of the user. */
9699
lastName?: string;
100+
101+
/** The username to give to the user. It must be unique across your instance. */
97102
username?: string;
103+
104+
/** The plaintext password to give the user. Must be at least 8 characters long, and can not be in any list of hacked passwords. */
98105
password?: string;
106+
107+
/** Set it to true if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a password. */
99108
skipPasswordChecks?: boolean;
109+
110+
/** Set to true to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a password. */
100111
signOutOfOtherSessions?: boolean;
112+
113+
/** The ID of the email address to set as primary. It must be verified, and present on the current user. */
101114
primaryEmailAddressID?: string;
115+
116+
/** If set to true, the user will be notified that their primary email address has changed. By default, no notification is sent. */
117+
notifyPrimaryEmailAddressChanged?: boolean;
118+
119+
/** The ID of the phone number to set as primary. It must be verified, and present on the current user. */
102120
primaryPhoneNumberID?: string;
121+
122+
/** The ID of the web3 wallets to set as primary. It must be verified, and present on the current user. */
103123
primaryWeb3WalletID?: string;
124+
125+
/** The ID of the image to set as the user's profile image */
104126
profileImageID?: string;
127+
128+
/**
129+
* In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it.
130+
* Please note that currently the supported options are:
131+
* - Period: 30 seconds
132+
* - Code length: 6 digits
133+
* - Algorithm: SHA1
134+
*/
105135
totpSecret?: string;
136+
137+
/** If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them. You must provide the backup codes in plain format or the corresponding bcrypt digest. */
106138
backupCodes?: string[];
139+
140+
/** The ID of the user as used in your external systems or your previous authentication solution. Must be unique across your instance. */
107141
externalId?: string;
142+
143+
/** A custom timestamp denoting when the user signed up to the application, specified in RFC3339 format (e.g. 2012-10-20T07:15:20.902Z). */
108144
createdAt?: Date;
145+
146+
/** When set to true all legal checks are skipped. It is not recommended to skip legal checks unless you are migrating a user to Clerk. */
109147
skipLegalChecks?: boolean;
148+
149+
/** A custom timestamp denoting when the user accepted legal requirements, specified in RFC3339 format (e.g. 2012-10-20T07:15:20.902Z). */
110150
legalAcceptedAt?: Date;
151+
152+
/** If true, the user can delete themselves with the Frontend API. */
111153
deleteSelfEnabled?: boolean;
154+
155+
/** If true, the user can create organizations with the Frontend API. */
112156
createOrganizationEnabled?: boolean;
157+
158+
/** The maximum number of organizations the user can create. 0 means unlimited. */
113159
createOrganizationsLimit?: number;
114160
} & UserMetadataParams &
115161
(UserPasswordHashingParams | object);

0 commit comments

Comments
 (0)