---
title: Identify your users
description: "Set a user ID when someone signs in and reset it when they log out, so Amplitude ties each person's events to one profile across devices."
product: general
lang: en
last_updated: 2026-10-21
token_estimate: 1426
---
# Identify your users

> For AI agents: a documentation index is available at [/docs/llms.txt](/docs/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

Amplitude identifies users through three IDs. The SDK sends a device ID automatically, Amplitude computes an Amplitude ID that joins a person's devices into one profile, and you set the user ID when someone signs in.

Setting a user ID is optional but recommended, because it lets Amplitude connect events from every device a person uses. Set it after a user creates an account or logs in. Amplitude also attaches the anonymous events from before sign-in to that user ID, so you don't need to set one for anonymous users. If your product doesn't assign user IDs, skip this page.

For how Amplitude merges devices and profiles, refer to [How Amplitude identifies unique users](https://amplitude.com/docs/data/sources/instrument-track-unique-users).

## Best practices for setting user IDs

- **Don't set the user ID if there isn't one.** For example, if you set the user ID to the string `None` for multiple users, Amplitude doesn't recognize those users as separate users. Instead, Amplitude assumes all those users are the same user and groups all events for those users together under that `None` user ID. You can always set the user ID later.
- **Don't assign a user ID that might change.** User IDs are fixed forever. For example, don't set a user's email address as their user ID, because email addresses change.
- **User IDs are case-sensitive.** If you set a user ID in a different case, Amplitude tracks two separate profiles for the same user.
- **Assigning user IDs server-side can be tricky.** If you encounter issues assigning user IDs, [contact Amplitude Support](https://support.amplitude.com).
- **Reset when the user logs out.** Otherwise, events from the next person on the same device attach to the previous user.

## Set the user ID

Set the user ID after a user signs up or logs in. Replace `USER_ID` with a stable identifier from your own system, not an email address. To describe the user, send an Identify object, which sets user properties without sending an event.

#### Browser

```ts
amplitude.setUserId("USER_ID");

const identifyEvent = new amplitude.Identify();
identifyEvent.set("location", "LA");
amplitude.identify(identifyEvent);
```

For every Identify operation, refer to [User properties](https://amplitude.com/docs/sdks/analytics/browser/browser-sdk-2#user-properties) in the Browser SDK documentation.

#### iOS

```swift
amplitude.setUserId(userId: "USER_ID")

let identify = Identify()
identify.set(property: "location", value: "LA")
amplitude.identify(identify: identify)
```

For every Identify operation, refer to [Unified SDK for Swift](https://amplitude.com/docs/sdks/analytics/ios/unified-sdk).

#### Android

```kotlin
amplitude.setUserId("USER_ID")

val identify = Identify()
identify.set("location", "LA")
amplitude.identify(identify)
```

For every Identify operation, refer to [Android Kotlin SDK](https://amplitude.com/docs/sdks/analytics/android/android-kotlin-sdk).

#### React Native

```javascript
import { setUserId, identify, Identify } from "@amplitude/analytics-react-native";

setUserId("USER_ID");

const identifyObj = new Identify();
identifyObj.set("location", "LA");
identify(identifyObj);
```

For every Identify operation, refer to [React Native SDK](https://amplitude.com/docs/sdks/analytics/react-native/react-native-sdk).

#### Flutter

```dart
amplitude.setUserId('USER_ID');

final Identify identify = Identify()..set('location', 'LA');
amplitude.identify(identify);
```

For every Identify operation, refer to [Flutter SDK](https://amplitude.com/docs/sdks/analytics/flutter/flutter-sdk-4).

#### Node.js

Server SDKs don't store a user ID. Pass `user_id` with each event and Identify call instead.

```javascript
import { track, identify, Identify } from "@amplitude/analytics-node";

track("Button Clicked", undefined, { user_id: "USER_ID" });

const identifyObj = new Identify();
identifyObj.set("location", "LA");
identify(identifyObj, { user_id: "USER_ID" });
```

For every Identify operation, refer to [Node.js SDK](https://amplitude.com/docs/sdks/analytics/node/node-js-sdk).

#### Python

Server SDKs don't store a user ID. Pass `user_id` with each event and Identify call instead.

```python
from amplitude import BaseEvent, EventOptions, Identify

amplitude.track(BaseEvent(event_type="Button Clicked", user_id="USER_ID"))

identify_obj = Identify()
identify_obj.set("location", "LA")
amplitude.identify(identify_obj, EventOptions(user_id="USER_ID"))
```

For every Identify operation, refer to [Python SDK](https://amplitude.com/docs/sdks/analytics/python/python-sdk).

For other platforms, refer to the user ID section of your platform's [SDK documentation](https://amplitude.com/docs/sdks).

## Reset the user when they log out

In client-side SDKs, call `reset` when a user logs out. `reset` clears the user ID and generates a new device ID, so the next activity on that device appears to Amplitude as a new user.

#### Browser

```ts
amplitude.reset();
```

#### iOS

```swift
amplitude.reset()
```

#### Android

```kotlin
amplitude.reset()
```

#### React Native

```javascript
import { reset } from "@amplitude/analytics-react-native";

reset();
```

#### Flutter

```dart
amplitude.reset();
```

#### Node.js

Server SDKs have no `reset` method, because they don't store a user ID between calls. After a user logs out, stop passing their `user_id` on events.

#### Python

Server SDKs have no `reset` method, because they don't store a user ID between calls. After a user logs out, stop passing their `user_id` on events.

