> 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/kmp/setup-luciq-for-kmp/custom-settings/setting-custom-data.md).

# Setting Custom Data

### User data (free-form string)

Attach a custom string to reports (e.g. JSON or key-value text):

{% code title="Kotlin" %}

```kotlin
LuciqKmp.setUserData("{\"plan\":\"premium\",\"region\":\"EU\"}")
```

{% endcode %}

### User attributes

Set key-value attributes that appear in the dashboard and on reports:

{% code title="Kotlin" %}

```kotlin
LuciqKmp.setUserAttribute("plan", "premium")
LuciqKmp.setUserAttribute("role", "admin")
val value = LuciqKmp.getUserAttribute("plan")           // suspend
val all = LuciqKmp.getAllUserAttributes()             // suspend
LuciqKmp.removeUserAttribute("role")
LuciqKmp.clearAllUserAttributes()
```

{% endcode %}

### User events

Log custom events (e.g. for analytics or filtering):

{% code title="Kotlin" %}

```kotlin
LuciqKmp.logUserEvent("purchase_completed")
```

{% endcode %}

### Tags

Append tags to bug reports for filtering and segmentation:

{% code title="Kotlin" %}

```kotlin
LuciqKmp.appendTags(listOf("beta", "v2"))
val tags = LuciqKmp.getTags()  // suspend
LuciqKmp.resetTags()
```

{% endcode %}

### App variant

Set the app variant (e.g. "beta", "production") for filtering in the dashboard. You can also set it in `LuciqConfiguration` at init:

{% code title="Kotlin" %}

```kotlin
LuciqKmp.setAppVariant("staging")
```

{% endcode %}

Note: On some platforms this may be primarily set at init; check behavior per platform.

### File attachments

Add file attachments to bug reports (e.g. logs or exports). You can add by file path or from in-memory data, and clear the list when needed:

{% code title="Kotlin" %}

```kotlin
LuciqKmp.addFileAttachment(path = "/path/to/log.txt", name = "log.txt")
LuciqKmp.addFileAttachmentWithData(data = bytes, fileName = "export.json")
LuciqKmp.clearFileAttachments()
```

{% endcode %}

Attachments added this way are included in the next report the user submits.

### Feature flags

Add or remove feature flags (for A/B or segment filtering):

{% code title="Kotlin" %}

```kotlin
LuciqKmp.addFeatureFlag(FeatureFlag(name = "new_checkout", variant = "on"))
LuciqKmp.addFeatureFlags(listOf(FeatureFlag("flag_a", "control"), FeatureFlag("flag_b", "test")))
LuciqKmp.removeFeatureFlag("new_checkout")
LuciqKmp.removeFeatureFlags(listOf("flag_a", "flag_b"))
LuciqKmp.removeAllFeatureFlags()
```

{% endcode %}


---

# 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/kmp/setup-luciq-for-kmp/custom-settings/setting-custom-data.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.
