userlens-analytics-sdk 0.1.84 → 0.1.86

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/README.md CHANGED
@@ -178,7 +178,13 @@ This mode sends events directly to the Userlens API from the frontend.
178
178
  const collector = new EventCollector({
179
179
  userId: "user-123", // ✅ required
180
180
  WRITE_CODE: "your-public-write-code", // ✅ required
181
- userTraits: { plan: "starter" }, // optional
181
+ userTraits: { plan: "starter" }, // ✅ required, pass as many traits as you can so Userlens provides better insights
182
+ groupId: "group-123", // passed to identify a group (e.g. company that the user belongs to)
183
+ groupTraits: {
184
+ domain: "userlens.io",
185
+ title: "Userlens",
186
+ industry: "Software"
187
+ }, // traits that exist on your group object (e.g. company workspace traits)
182
188
  intervalTime: 5000, // optional
183
189
  });
184
190
  ```
@@ -257,8 +263,16 @@ const config = useMemo(
257
263
  // Required only if you're enabling session recording
258
264
  // or using auto-upload mode for EventCollector
259
265
  userId: "user-123",
260
- // Optional — used when letting the SDK handle event uploads automatically
266
+ // Used when letting the SDK handle event uploads automatically. Keeps traits up-to-date.
261
267
  userTraits: { email: "jane@example.com" },
268
+ // Used when letting the SDK handle event uploads automatically. Associates user with a group (e.g. company).
269
+ groupId: "company-123",
270
+ // Used when letting the SDK handle event uploads automatically. Keeps group traits up-to-date.
271
+ groupTraits: {
272
+ domain: "userlens.io",
273
+ title: "Userlens",
274
+ industry: "Software"
275
+ },
262
276
  eventCollector: {
263
277
  // Required when you want to manually handle event forwarding
264
278
  callback: (events) => {