> 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/ios/setup-luciq-for-ios/custom-settings/user-identification.md).

# User identification

Luciq helps you better identify the bug reports or feedback you get by associating a user's identity to them.

### 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.

<figure><img src="/files/EZmCxOdkKfIzkOCqhkgZ" alt=""><figcaption><p><br><em>An example of a pre-filled email field in the bug reporting form.</em></p></figcaption></figure>

Ideally, this API should be called as soon as a user logs into your app.

{% tabs %}
{% tab title="Swift" %}
{% code overflow="wrap" %}

```swift
Luciq.identifyUser(withID: "2374927027", email: "john.appleseed@apple.com", name: "John Appleseed")
```

{% endcode %}
{% endtab %}

{% tab title="Objective-C" %}
{% code overflow="wrap" %}

```objectivec
[Luciq identifyUserWithID:@"2374927027" email:@"john.appleseed@apple.com" name:@"John Appleseed"];
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% 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 through an error.
{% endhint %}

### User Data

You can also 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 to be attached. The maximum length of the string is 1,000 characters.

{% tabs %}
{% tab title="Swift" %}
{% code overflow="wrap" %}

```swift
let profileDetails = user.allProfileDetails()
let profileDetailsString = "\(profileDetails)"
Luciq.userData = profileDetailsString
```

{% endcode %}
{% endtab %}

{% tab title="Objective-C" %}
{% code overflow="wrap" %}

```objectivec
NSDictionary *profileDetails = [user allProfileDetails];
NSString *profileDetailsString = [NSString stringWithFormat:@"%@", profileDetails];
Luciq.userData = profileDetailsString;
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Logout

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

{% tabs %}
{% tab title="Swift" %}
{% code overflow="wrap" %}

```swift
Luciq.logOut()
```

{% endcode %}
{% endtab %}

{% tab title="Objective-C" %}
{% code overflow="wrap" %}

```objectivec
[Luciq logOut];
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="warning" %}

### Logout only when user is identified

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

{% hint style="info" %}

### Isolating sessions per user

If multiple users sign in and out on the same device within a single app session, Luciq can automatically start a new session on logout so that each user's activity is attributed to the correct identity. This behavior is disabled by default — reach out to the customer support team to enable it. It is available starting from iOS SDK v19.8.1.
{% 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
