> For the complete documentation index, see [llms.txt](https://developers.memberspace.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.memberspace.com/javascript-api/overview/functions/memberspace.updatemembermetadata.md).

# MemberSpace.updateMemberMetadata

An Asynchronous function (returns a Promise). It merges the data it gets as a parameter with the data stored in our servers as the member's metadata, and updates the stored information with the result.

```javascript
const dataToSet = {
    key1: 'value1',
    key2: {
        key3: 'value3'
    }
};

// Using async-await
const fn = async () => {
    await MemberSpace.updateMemberMetadata(dataToSet);

    // continue custom code
};

// Using Promise chaining
MemberSpace
  .updateMemberMetadata(dataToSet)
  .then(() => {
    // continue custom code
  });
```

{% hint style="info" %}
As a limitation, to enforce best practices the top level of the metadata must be an object.

The initial state of the metadata storage is `{}` (an empty object).

You can remove a key from any level by assigning `null` to it, but you cannot assign null as the content of the entire storage. To clear the storage please see [this](/javascript-api/overview/functions/memberspace.clearmembermetadata.md) function.
{% endhint %}
