# edit

Learn how to update the user's profile.

This method creates a patch to apply changes to the [user's profile](/reference/user/overview).

## Signature

This method has the following signature:

```ts
user.edit(): Patch
```

The return is a [`Patch`](/reference/sdk/javascript/api/patch) for specifying the sequence of operations to apply to the user's profile. Calling [`save`](/reference/sdk/javascript/api/patch/save) on the patch returns a promise that resolves to the [`userProfileChanged`](/reference/event/types/user-account/user-profile-changed) event after successful transmission.

## Example

Here is a basic example of how to use this method:

```ts
import croct from '@croct/plug';

const patch = croct.user.edit();

const promise = patch
  .set('company', 'Croct')
  .add('interests', 'JavaScript')
  .add('custom.pets', 'crocodile')
  .save();

promise.then(() => console.log('Profile updated successfully'));
```
