Skip to content

docs: sync README with latest SDK API#25

Closed
gunoooo wants to merge 1 commit intomainfrom
sync-readme
Closed

docs: sync README with latest SDK API#25
gunoooo wants to merge 1 commit intomainfrom
sync-readme

Conversation

@gunoooo
Copy link
Contributor

@gunoooo gunoooo commented Feb 23, 2026

Summary

  • Update installation version to 1.5.0
  • Update User Management section: remove deprecated removeUserId(), add reset() section

Summary by CodeRabbit

  • New Features

    • Added a full device identity reset option that replaces the prior user-removal approach.
  • Documentation

    • README updated with the new reset workflow and guidance to reinitialize the SDK after a reset.
    • Example dependency version in the README updated to reflect the newer recommended release.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

Walkthrough

README updated: dependency example bumped to 1.5.0, usage example replaced removeUserId() with Clix.reset(), and a new Reset section describing when and what reset() does (device ID rotation, user ID removal, data cleared). No exported signatures changed in this diff.

Changes

Cohort / File(s) Summary
Documentation
README.md
Bumped example dependency from 1.3.2 -> 1.5.0; replaced Clix.removeUserId() usage with Clix.reset() in examples; added a Reset section explaining that reset() generates a new device ID, removes stored user ID, clears local data, and requires initialize() to be called again.
Public API notes
README.md (documentation of API behavior)
Documented reset() behavior and guidance (when to use and avoid calling on every logout). No signatures or exported declarations were changed in this diff.

Possibly related PRs

Suggested reviewers

  • nyanxyz
  • pitzcarraldo
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately summarizes the main objective of the changeset, which is updating the README documentation to reflect the latest SDK API changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sync-readme

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 75-78: The README snippet uses Clix.setUserId(null) but the SDK
API declares fun setUserId(userId: String) (non-nullable), so update either the
SDK or the docs: Option A — change the SDK signature to fun setUserId(userId:
String?) and update the implementation of setUserId to handle null (clear the
user id while keeping device id), ensuring callers and tests compile; Option B —
leave the SDK signature as-is and revise README.md to remove the null example
and show the correct usage (e.g., document that setUserId requires a non-null
String and show an example call like Clix.setUserId("newUserId") or provide the
supported way to remove a user id if the SDK exposes a clearUserId/alternative
API). Reference the setUserId function and README.md when making the change.
- Line 22: The dependency declaration
implementation("so.clix:clix-android-sdk:1.5.0") is invalid and will fail to
resolve; locate the correct groupId:artifactId:version by checking the library's
Maven Central/GitHub/official docs, then replace the string in the README (and
corresponding build.gradle/Kotlin DSL files if present) with the verified
coordinates (for example updating the version or correcting the
artifactId/groupId as found); ensure the exact literal implementation(...) token
is updated so builds can resolve the dependency.
- Around line 98-108: Update the Reset section to accurately describe that
reset() only deletes the stored device ID locally (it does not generate a new
device ID immediately) and that a new device ID will be created later when
initialize() is called; also clarify that reset() does not remove the user ID
from the backend because user IDs are not stored locally—advise using
setUserId(null) (or the existing recommended pattern) to explicitly clear the
user ID on the backend if desired.

```kotlin
dependencies {
implementation("so.clix:clix-android-sdk:1.3.2")
implementation("so.clix:clix-android-sdk:1.5.0")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if clix-android-sdk version 1.5.0 exists on Maven Central

echo "Checking Maven Central for so.clix:clix-android-sdk versions..."

# Query Maven Central API for available versions
response=$(curl -s "https://search.maven.org/solrsearch/select?q=g:so.clix+AND+a:clix-android-sdk&rows=50&wt=json")

echo "Available versions:"
echo "$response" | jq -r '.response.docs[] | .v' 2>/dev/null | sort -V

echo ""
echo "Checking if 1.5.0 specifically exists:"
if echo "$response" | jq -r '.response.docs[] | .v' 2>/dev/null | grep -q "^1\.5\.0$"; then
    echo "✓ Version 1.5.0 found"
else
    echo "✗ Version 1.5.0 NOT found"
fi

Repository: clix-so/clix-android-sdk

Length of output: 217


Correct the dependency version or verify the correct coordinates.

Version 1.5.0 of so.clix:clix-android-sdk does not appear to exist on Maven Central Repository. This dependency specification will fail to resolve during builds. Verify the correct version number and group/artifact ID and update line 22 accordingly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 22, The dependency declaration
implementation("so.clix:clix-android-sdk:1.5.0") is invalid and will fail to
resolve; locate the correct groupId:artifactId:version by checking the library's
Maven Central/GitHub/official docs, then replace the string in the README (and
corresponding build.gradle/Kotlin DSL files if present) with the verified
coordinates (for example updating the version or correcting the
artifactId/groupId as found); ensure the exact literal implementation(...) token
is updated so builds can resolve the dependency.

README.md Outdated
Comment on lines +98 to +108
### Reset

Use `reset()` when you need a completely fresh device identity (e.g., shared device scenarios). This generates a new device ID, removes the user ID, and clears session data.

```kotlin
lifecycleScope.launch {
Clix.removeUserId()
Clix.reset()
}
```

> **Note:** Do not call `reset()` on every logout. In most cases, simply call `setUserId(null)` or set a new user ID when the next user logs in.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for reset() method in Clix.kt
rg -n "fun\s+(suspend\s+)?reset\s*\(" clix/src/main/kotlin/so/clix/core/Clix.kt -A 10

Repository: clix-so/clix-android-sdk

Length of output: 468


🏁 Script executed:

#!/bin/bash
# Search for userId removal or handling in reset-related code
rg -n "userId" clix/src/main/kotlin/so/clix/core/Clix.kt -B 2 -A 2

# Search for setUserId method to understand user ID management
rg -n "fun setUserId" clix/src/main/kotlin/so/clix/core/Clix.kt -A 10

# Check notificationService.reset() implementation
fd "NotificationService" clix/src/main/kotlin --type f -exec grep -l "fun reset" {} \;

Repository: clix-so/clix-android-sdk

Length of output: 1051


🏁 Script executed:

#!/bin/bash
# Search for where device ID is generated
rg -n "clix_device_id" clix/src/main/kotlin --type=kt -B 3 -A 3

# Search for NotificationService implementation
find clix/src/main/kotlin -name "*NotificationService*" -type f

# Search for userId in notificationService
rg -n "userId" clix/src/main/kotlin -l

Repository: clix-so/clix-android-sdk

Length of output: 382


🏁 Script executed:

#!/bin/bash
# Search for clix_device_id without type filter
rg -n "clix_device_id" clix/src/main/kotlin -B 3 -A 3

# Read NotificationService.kt
cat -n clix/src/main/kotlin/so/clix/services/NotificationService.kt

# Check DeviceService for device ID generation
rg -n "generateDeviceId\|clix_device_id" clix/src/main/kotlin/so/clix/services/DeviceService.kt -B 2 -A 2

Repository: clix-so/clix-android-sdk

Length of output: 16532


🏁 Script executed:

#!/bin/bash
# Find SessionService file
find clix/src/main/kotlin -name "*SessionService*" -type f

# Search for userId in session management
rg -n "userId\|projectUserId" clix/src/main/kotlin/so/clix/services --type=kotlin -B 2 -A 2

Repository: clix-so/clix-android-sdk

Length of output: 123


🏁 Script executed:

#!/bin/bash
# Read SessionService.kt to check if stop() removes user ID
cat -n clix/src/main/kotlin/so/clix/services/SessionService.kt

# Also search for any initialization logic that generates device ID
rg -n "UUID\|Random" clix/src/main/kotlin/so/clix/services/DeviceService.kt -B 2 -A 2

Repository: clix-so/clix-android-sdk

Length of output: 3077


🏁 Script executed:

#!/bin/bash
# Search for userId or projectUserId storage keys
rg -n "userId\|projectUserId" clix/src/main/kotlin/so/clix/services/DeviceService.kt -B 3 -A 3

# Read full DeviceService to understand user ID management
cat -n clix/src/main/kotlin/so/clix/services/DeviceService.kt | head -60

Repository: clix-so/clix-android-sdk

Length of output: 2907


🏁 Script executed:

#!/bin/bash
# Final verification: search for any local user ID storage key
rg -n "userId\|user_id\|USER_ID" clix/src/main/kotlin/so/clix/services --type=kotlin | head -20

# Confirm initialize() calls getCurrentDeviceId()
rg -n "getCurrentDeviceId\|initialize" clix/src/main/kotlin/so/clix/core/Clix.kt -B 2 -A 2

Repository: clix-so/clix-android-sdk

Length of output: 50


Clarify the device ID and user ID behavior in the reset() documentation.

The documentation claims reset() "generates a new device ID" and "removes the user ID," but the actual behavior differs:

  1. Device ID: reset() removes the old device ID from local storage; a new one is generated on the next initialize() call, not during reset() itself.

  2. User ID: The user ID is not stored locally and is not removed by reset(). It remains on the backend as an orphaned record, which is intentional. If you need to explicitly remove the user ID from the backend, use setUserId(null) or the pattern recommended in the note.

Update the documentation to accurately reflect this behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 98 - 108, Update the Reset section to accurately
describe that reset() only deletes the stored device ID locally (it does not
generate a new device ID immediately) and that a new device ID will be created
later when initialize() is called; also clarify that reset() does not remove the
user ID from the backend because user IDs are not stored locally—advise using
setUserId(null) (or the existing recommended pattern) to explicitly clear the
user ID on the backend if desired.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5290eb6301

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


### Reset

Use `reset()` when you need a completely fresh device identity (e.g., shared device scenarios). This generates a new device ID, removes the user ID, and clears session data.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Document reinitialization requirement after reset

The new Reset section says reset() gives a fresh identity, but it omits that SDK users must call Clix.initialize(...) again before tracking anything; Clix.reset() sets isInitialized = false and clears storage, while event APIs still read Clix.environment.deviceId until reinit (clix/src/main/kotlin/so/clix/core/Clix.kt and clix/src/main/kotlin/so/clix/services/EventService.kt). In apps that follow this README literally and continue tracking after reset, events can be attributed to stale device state.

Useful? React with 👍 / 👎.

README.md Outdated
}
```

> **Note:** Do not call `reset()` on every logout. In most cases, simply call `removeUserId()` or set a new user ID when the next user logs in.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop recommending deprecated removeUserId for logout

The note recommends calling removeUserId() for normal logout, but in this release that API is explicitly deprecated in favor of reset() (clix/src/main/kotlin/so/clix/core/Clix.kt and CHANGELOG.md). Keeping deprecated guidance in the primary usage docs will steer integrators toward an API that is being phased out, creating avoidable migration churn.

Useful? React with 👍 / 👎.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@README.md`:
- Line 95: Update the README's description of reset() to accurately state that
reset() only deletes the locally stored device ID and clears local session data
(it does not generate a new device ID or make any network/server calls), that
user IDs are not stored locally so reset() does not remove them (backend user
records remain and may be orphaned intentionally), and that a new device ID is
only created later when initialize() is called; use the function names reset()
and initialize() in the revised text for clarity.
- Line 22: Check that the declared dependency
implementation("so.clix:clix-android-sdk:1.5.0") is published on Maven Central;
run the provided curl/jq script (or query search.maven.org) to confirm version
1.5.0 exists and if it does not, update the dependency string in README.md to a
published version (or pin to the latest available version shown by the query)
and re-run your build to verify resolution.

@gunoooo gunoooo changed the title Sync README with latest SDK API docs: sync README with latest SDK API Feb 23, 2026
@gunoooo gunoooo closed this Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant