humanbehavior-js 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -5968,6 +5968,15 @@ userData, apiKey) {
5968
5968
  error: `Failed to identify user: ${response.status} ${response.statusText} - ${errorText}`
5969
5969
  };
5970
5970
  }
5971
+ const result = yield response.json();
5972
+ // If server found existing user, return the actual userId
5973
+ if (result.actualUserId && result.actualUserId !== userId) {
5974
+ console.log(`🔄 Server found existing user: ${result.actualUserId} (sent: ${userId})`);
5975
+ return {
5976
+ success: true,
5977
+ actualUserId: result.actualUserId
5978
+ };
5979
+ }
5971
5980
  return { success: true };
5972
5981
  }
5973
5982
  catch (error) {