update
Updates the current user, or the user with the given session ID, with the provided parameters.
When UpdateParams.unsafeMetadata is provided, the SDK issues a PATCH /v1/me (or GET /v1/me when no non-metadata fields are present) followed by PATCH /v1/me/metadata carrying the computed merge patch. The metadata PATCH is skipped when the diff is empty. As a result, the operation is no longer server-atomic when both kinds of fields are submitted together — if the first call succeeds and the second fails, the non-metadata fields will have been persisted while the metadata is unchanged. Callers that need strict atomicity should call update and updateMetadata separately and handle partial failures themselves.
The pre-metadata /v1/me call also serves as a freshness anchor: the merge-patch diff is computed against the server's current state, not the locally cached value on this. Without that step, server-side mutations made by another tab, client, or backend job would silently survive the "replace" call.
Return
A ClerkResult containing the updated User if the operation was successful, or a ClerkErrorResponse if it failed.
Parameters
The parameters to update the user with. See: UpdateParams.