---
id: auth-update
title: "auth.update()"
slug: auth-update
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
---

import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';

Updates user data, if there is a logged in user.


<Tabs
  defaultActiveId="dart"
  groupId="reference/dart"
  values={[{ label: 'Dart', value: 'dart' }]}>

<TabsPanel id="dart" label="dart">

```dart
final res = await supabase.auth.update(
  UserAttributes(data: {'hello': 'world'})
);

final error = res.error;
```


</TabsPanel>

</Tabs>





## Notes

It's generally better to store user data in a table inside your public schema (i.e. `public.users`). 
Use the `update()` method if you have data which rarely changes or is specific only to the logged in user.










## Examples

### Update a user's metadata.



<Tabs
  defaultActiveId="dart"
  groupId="reference/dart"
  values={[{ label: 'Dart', value: 'dart' }]}>

<TabsPanel id="dart" label="dart">

```dart
final res = await supabase.auth.update(
  UserAttributes(data: {'hello': 'world'})
);

final error = res.error;
```


</TabsPanel>

</Tabs>