# Getting profile information

> [!WARNING]
> **Warning:** The Google Sign-In library optionally uses FedCM APIs, and their use will become a requirement. [Conduct an impact assessment](https://developers.google.com/identity/sign-in/web/gsi-with-fedcm) to confirm that user sign-in continues to function as expected.   
>
> Support for the Google Sign-In library is deprecated, see the [Deprecation and Sunset](https://developers.google.com/identity/sign-in/web/deprecation-and-sunset) guide for more.

After you have signed in a user with Google using the default scopes, you can
access the user's Google ID, name, profile URL, and email address.

> [!IMPORTANT]
> **Important:** Do not use the Google IDs returned by `getId()` or the user's profile information to communicate the currently signed in user to your backend server. Instead, [send ID tokens](https://developers.google.com/identity/sign-in/web/backend-auth), which can be securely validated on the server.

To retrieve profile information for a user, use the [`getBasicProfile()`](https://developers.google.com/identity/sign-in/web/reference#googleusergetbasicprofile)
method. For example:

    // auth2 is initialized with gapi.auth2.init() and a user is signed in.

    if (auth2.isSignedIn.get()) {
      var profile = auth2.currentUser.get().getBasicProfile();
      console.log('ID: ' + profile.getId());
      console.log('Full Name: ' + profile.getName());
      console.log('Given Name: ' + profile.getGivenName());
      console.log('Family Name: ' + profile.getFamilyName());
      console.log('Image URL: ' + profile.getImageUrl());
      console.log('Email: ' + profile.getEmail());
    }

> [!NOTE]
> **Note:** A Google account's email address can change, so don't use it to identify a user. Instead, use the account's ID, which you can get on the client with `getBasicProfile().getId()`, and on the backend from the `sub` claim of the ID token.