updateMetadata

Updates the current user's metadata via PATCH /v1/me/metadata with deep-merge semantics: keys in the patch overwrite or extend the current unsafeMetadata, and any key set to null is removed at any nesting level.

Return

A ClerkResult containing the updated User if the operation was successful, or a ClerkErrorResponse if it failed.

Parameters

params

The parameters to update the user's metadata with. See: UpdateMetadataParams.


suspend fun User.updateMetadata(unsafeMetadata: JsonObject): ClerkResult<User, ClerkErrorResponse>

Convenience overload of updateMetadata that accepts a parsed JsonObject for unsafeMetadata. The SDK handles JSON serialization for you.

Return

A ClerkResult containing the updated User on success or a ClerkErrorResponse on failure.

Parameters

unsafeMetadata

The metadata patch to merge with the current value. Use JsonNull for any key whose value should be removed.

See also