> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-actions-triggers-prototype.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Learn how to uniquely identify users.

# Identify Users

There are two recommended options to uniquely identify your users:

1. By the `user_id` property. This is guaranteed to be unique (within a tenant) per user (such as `{identity provider id}|{unique id in the provider}` or `facebook|1234567890`). A user may have the same `user_id` property across multiple Auth0 tenants, but consistency is not guaranteed.
2. By a natural key, like the `email` property. In this case, it is recommended that you enable email verification and only use this option with providers that require that users verify their emails.

For [regular](/docs/authenticate/database-connections/auth0-user-store) and [custom](/docs/authenticate/database-connections/custom-db) database connections, avoid creating duplicate `user_id`s within a tenant for different database connections. If you expect possible collisions between IDs from different connections, you should use a prefix identifying the connection.

The following code sample shows a custom database connection identified with the prefix, `MyConnection1|`:

```javascript lines theme={null}
function login (email, password, callback) {
  var user = getUserFromDB(email);
  var profile = {
    user_id: 'MyConnection1|' + user.id,
    email: user.email,
    [...]
  };
  callback(null, profile);
}
```
