> For the complete documentation index, see [llms.txt](https://docs.luciq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.luciq.ai/flutter/setup-luciq-for-flutter/custom-settings/user-identification.md).

# User Identification

Bind every report from your Flutter app to a known person. Covers setting user email, name, and a unique user ID, plus custom user and device attributes.

### User Email and Name

If you already have a user's name and email, you can pre-fill the email field in the bug, feedback, and question reporting flow. The user will then be identified in all reports (bugs, improvements, questions), crashes, surveys, and feature requests.

Ideally, call this API as soon as a user logs into your app.

{% code title="Dart" %}

```dart
Luciq.identifyUser(String email, [String name, String id]);
```

{% endcode %}

{% hint style="danger" %}
The userID Must Be Unique

The `userID` you provide is the primary identifier for a user within Luciq. You must ensure that this ID is unique for each of your users.

Providing a generic, non-unique ID (e.g., `guest` or `unknown_user`) for multiple users will cause their data to be incorrectly merged. This can lead to critical data integrity and privacy issues, such as different users being able to see and reply to each other's private chat conversations.

If a user is anonymous, do not call the `identifyUser` API. The SDK will automatically handle a unique anonymous identity for you.
{% endhint %}

{% hint style="warning" %}
Null Values

If both the `email` and `ID` parameters are empty or null, the user will not be identified, and the SDK will throw an error.
{% endhint %}

### User Data

You can add additional data about your users. This API is best used for dumping large amounts of data. Each call to this method overrides the user data attached. The maximum length of the string is 1,000 characters.

{% code title="Dart" %}

```dart
Luciq.setUserData("User data sample");
```

{% endcode %}

### Logout

When a user logs out, call the following API. Calling `logOut` will reset the email and name previously set. It will also remove any currently set user attributes, user events, user chats, and user data.

{% code title="Dart" %}

```dart
Luciq.logOut();
```

{% endcode %}

{% hint style="warning" %}
Logout only when user is identified

If the user is not currently identified using the `identifyUser` API, the `logOut` method will have no effect.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.luciq.ai/flutter/setup-luciq-for-flutter/custom-settings/user-identification.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
