Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated Apr 29, 2024

Identify user

This API sends information about the current user to Amazon Pinpoint.

Additional information such as the user's name, email, location, and device can be included by specifying the UserProfile. Custom attributes can also be included by setting UserProfile.customProperties.

If the user was signed in through signIn you can retrieve the current user's ID as shown below:

import { identifyUser } from 'aws-amplify/analytics';
import { getCurrentUser } from 'aws-amplify/auth';
const location = {
latitude: 47.606209,
longitude: -122.332069,
postalCode: '98122',
city: 'Seattle',
region: 'WA',
country: 'USA'
const customProperties = {
plan: ['plan'],
phoneNumber: ['+11234567890'],
age: ['25']
const userProfile = {
name: 'username',
email: '',
async function sendUserData() {
const user = await getCurrentUser();
userId: user.userId,