Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Better Auth · Module

updateUser

Better Auth's client exposes updateUser for changing user information. Supply the desired profile fields in an object, such as image and name.

How it works

Call the client’s updateUser method with an object containing the profile fields to change. The documented example updates both image and name for the current user.

Syntax

await authClient.updateUser({ image, name })

Parameters

NameTypeDescription
dataobjectObject containing the user information to update; the page's example includes image and name.

Key points

  • Use the client-provided updateUser function to change the current user's information.
  • Pass the updates as a single object rather than as positional arguments.
  • The call is asynchronous, so await the returned operation when updating profile data.
  • The documented payload supports an image URL for the user's profile image.
  • The documented payload supports changing the user's display name.

Example: Update the current user's profile

import { authClient } from "@/lib/auth-client"

await authClient.updateUser({
  image: "https://example.com/image.jpg",
  name: "John Doe",
})

Updates the signed-in user's profile image and display name through the configured Better Auth client.

When to use it

Change profile image

Let a signed-in user replace their avatar URL from an account-settings screen.

Change display name

Let a signed-in user edit the name shown throughout the application.

Save profile changes

Submit several profile edits together after a settings form is saved.

Interview questions

QHow do you update a user's profile information?

Call authClient.updateUser with an object containing the user fields that should change. The documented example passes image and name.

Follow-up: How would you update only one field? Pass an object containing only that field, such as { name: "New Name" }, assuming the client supports the field.

QWhat object is used to invoke updateUser?

The method is exposed by the Better Auth client, so the client must already be configured and imported before calling it. The page demonstrates importing authClient from a local auth-client module.

Follow-up: Where should client configuration live? In the application's shared Better Auth client module, which can then be imported wherever profile updates are needed.

QWhich fields does the official example update?

The documented update payload includes image and name properties. The image value is a URL string, while name is the user's display-name string.

Follow-up: What should be validated before sending an image URL? Validate the URL and any application-specific profile rules before invoking the client method.

  • authClient
  • createAuthClient
  • users and accounts

Source: User & Accounts | Better Auth. Checked 2026-10-15.