# User Management

Identify, reset, and attach attributes to Unity players.

Superwall starts with an anonymous user ID. Identify players after login or account creation so
paywall assignments and analytics follow the same user across devices.

Identify a User [#identify-a-user]

```csharp C#
using Superwall;

public void OnLoginComplete(string userId)
{
    Superwall.Shared.Identify(userId);
}
```

If you want Superwall to restore paywall assignments after identifying the user, pass
`IdentityOptions`.

```csharp C#
Superwall.Shared.Identify(
    "user_123",
    new IdentityOptions { RestorePaywallAssignments = true }
);
```

Reset on Logout [#reset-on-logout]

Call `Reset` when the player logs out.

```csharp C#
public void OnLogout()
{
    Superwall.Shared.Reset();
}
```

Set User Attributes [#set-user-attributes]

Use attributes to target audiences and personalize paywalls.

```csharp C#
using System.Collections.Generic;
using Superwall;

Superwall.Shared.SetUserAttributes(new Dictionary<string, object>
{
    { "player_level", 42 },
    { "guild_id", "north_star" },
    { "completed_tutorial", true }
});
```

You can read the current attributes from Unity:

```csharp C#
var attributes = Superwall.Shared.GetUserAttributes();
```

Read Identity State [#read-identity-state]

```csharp C#
var userId = Superwall.Shared.UserId;
var isLoggedIn = Superwall.Shared.IsLoggedIn;
```

> **Note**

Avoid sending personally identifiable information as plain user attributes unless your privacy
policy and data processing setup allow it.