> This page is for version V3 - Beta (default).
> For other versions, use one of these documentation indexes:
> - V3 - Beta (default): https://docs.authlyx.dev/v3/llms.txt
> - V2 - Legacy: https://docs.authlyx.dev/v2/llms.txt
> - V1 - End of support: https://docs.authlyx.dev/v1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.authlyx.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.authlyx.dev/_mcp/server.

# User Data

> Read the signed-in identity, its access details, and its plan features.

After a successful login or registration, the SDK keeps the current identity data available on its client object. Read it wherever your app needs to show the signed-in person's details. It is cleared when the person signs out or AuthlyX confirms that access has ended. The exact access syntax differs by language, as shown below.

The exact object shape depends on the language. The API fields use camelCase. C# exposes a typed `UserData` object with PascalCase properties. C++, Python, JavaScript, TypeScript, and Go keep the API fields and add a smaller set of PascalCase aliases. Java and Rust expose the API fields directly.

## Fields you can read

| API field       | C# property            | What it contains                                                                                                 |
| --------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `identityId`    | `Id`                   | ID of the signed-in record. C# reads this from the login response envelope.                                      |
| `type`          | `LoginType`            | `user`, `license`, or `device`, describing how this identity is stored.                                          |
| `name`          | `Username`             | Name for this login. C# and the alias-enabled SDKs set `Username` only for user accounts.                        |
| `licenseKey`    | `LicenseKey`           | Linked key when this identity has one. It can be empty for device login. Treat it as private account data.       |
| `email`         | `Email`                | Email saved on the user record, if one was provided.                                                             |
| `systemId`      | `SID`, `Hwid`          | Device identifier used for this sign-in, when applicable.                                                        |
| `plan`          | `Plan`, `Subscription` | Plan name assigned to the identity.                                                                              |
| `expiry`        | `ExpiryDate`           | Access expiration time, or `null` for lifetime access. C# also exposes `IsLifetime`, calculated from this value. |
| `deviceLimit`   | `DeviceLimit`          | Number of devices allowed for this identity.                                                                     |
| `registeredAt`  | `RegisteredAt`         | When the identity was created, when the server has that date.                                                    |
| `lastLogin`     | `LastLogin`            | Most recent successful login time.                                                                               |
| `ipAddress`     | `IpAddress`            | Address observed by AuthlyX during sign-in. Avoid showing it unless your app needs it.                           |
| `country`       | `Country`              | Approximate country derived from that address. It is not GPS or a precise location.                              |
| `features`      | `Features`             | Names of enabled Boolean features inherited from the plan or set on this identity. Expired features are omitted. |
| `featureValues` | `FeatureValues`        | Current feature values, including text and numbers. Identity values override plan defaults.                      |
| `metadata`      | `Metadata`             | Public metadata allowed for SDK access. Private metadata is not sent to the customer app.                        |

The C++, Python, JavaScript, TypeScript, and Go SDKs currently add these PascalCase aliases: `Username`, `LicenseKey`, `SID`, `Email`, `Plan`, `ExpiryDate`, `Country`, `IpAddress`, and `DeviceLimit`. Their raw API fields, including `features`, `featureValues`, `metadata`, `registeredAt`, and `lastLogin`, remain camelCase. Java and Rust use the raw API names. C# exposes the typed properties shown in the table, plus `Hwid` as an alias for `SID` and `Subscription` as an alias for `Plan`.

Some fields do not apply to every sign-in. For example, a device identity may not have a username, email, or license key. Do not assume an empty field means the login failed.

## Example data

This is an example of the identity information returned after a successful sign-in. The values are illustrative; your app receives its own account data.

```json
{
  "type": "user",
  "name": "maya",
  "licenseKey": "MAYA-4R8P-2N6K-9Q3W",
  "email": "maya@example.com",
  "systemId": "S-1-5-21-1938475620-2719458301-1209384756-1001",
  "plan": "Plus",
  "expiry": "2027-04-30T23:59:59.000Z",
  "deviceLimit": 3,
  "registeredAt": "2026-08-12T14:22:10.000Z",
  "lastLogin": "2026-10-28T18:41:32.000Z",
  "ipAddress": "203.0.113.42",
  "country": "NG",
  "features": ["exportPdf", "cloudSync"],
  "featureValues": {
    "videoQuality": "4K",
    "monthlyExports": 250
  },
  "metadata": {
    "customerTier": "studio"
  }
}
```

## Read values in your app

The SDK stores this data after login. These examples read it; they do not make another API request.

#### C\#

```csharp
var username = app.userData.Username;
var plan = app.userData.Plan;
var expiry = app.userData.ExpiryDate;
var features = app.userData.Features;
var videoQuality = app.userData.FeatureValues["videoQuality"];
```

#### JavaScript / Node.js

```javascript
const username = app.userData.Username;
const plan = app.userData.Plan;
const expiry = app.userData.ExpiryDate;
const features = app.userData.features;
const videoQuality = app.userData.featureValues.videoQuality;
```

#### TypeScript

```typescript
const username = app.userData.Username;
const plan = app.userData.Plan;
const expiry = app.userData.ExpiryDate;
const features = app.userData.features;
const videoQuality = app.userData.featureValues.videoQuality;
```

#### Python

```python
username = app.userData["Username"]
plan = app.userData["Plan"]
expiry = app.userData["ExpiryDate"]
features = app.userData["features"]
video_quality = app.userData["featureValues"]["videoQuality"]
```

#### C++

```cpp
auto user = app.userData();
auto username = user.value("Username", "");
auto plan = user.value("Plan", "");
auto expiry = user.value("ExpiryDate", "");
auto features = user.value("features", nlohmann::json::array());
auto quality = user["featureValues"].value("videoQuality", "");
```

#### Java

```java
var user = app.userData;
String username = user.path("name").asText("");
String plan = user.path("plan").asText("");
String expiry = user.path("expiry").asText("");
var features = user.path("features");
String quality = user.path("featureValues").path("videoQuality").asText("");
```

#### Go

```go
user, err := app.UserData(ctx)
if err != nil {
    return err
}
username := user["Username"]
plan := user["Plan"]
expiry := user["ExpiryDate"]
features := user["features"]
```

#### Rust

```rust
let user = app.userData();
let username = user["name"].as_str().unwrap_or_default();
let plan = user["plan"].as_str().unwrap_or_default();
let expiry = user["expiry"].as_str().unwrap_or_default();
let features = &user["features"];
```

Use [Check session](/sdks/methods/heartbeats) when you need current authorization. User Data is convenient account information; it is not a substitute for a session check or a server-side permission check.