[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M737Q2YEE7DN45ZYF151Q5Q3":3,"skill-same:01M737Q2YEE7DN45ZYF151Q5Q3":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M737Q2YEE7DN45ZYF151Q5Q3","skill-077",null,"Comprehensive guide for implementing Fullstory's User Properties API (setProperties with type 'user') for web applications. Teaches proper property naming, type handling, incremental updates, and special fields (displayName, email). Includes detailed good\u002Fbad examples for CRM integration, progressive profiling, and subscription tracking to help developers enrich user profiles for analytics and segmentation.","legendtkl\u002Fagentic-skill-router","legendtkl","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2370761?v=4","01M71RR3WRQC40G964Q2GVDMND","01M737GJZQ9TF1VE3VM255EDAK",8,"MIT","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Fexperiments\u002Fdci-compare\u002Fskillrouter-skills\u002Fskill-077\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: skill-077\ndescription: \"Comprehensive guide for implementing Fullstory's User Properties API (setProperties with type 'user') for web applications. Teaches proper property naming, type handling, incremental updates, and special fields (displayName, email). Includes detailed good\u002Fbad examples for CRM integration, progressive profiling, and subscription tracking to help developers enrich user profiles for analytics and segmentation.\"\n---\n\n# Fullstory User Properties API\n\n## Overview\n\nFullstory's User Properties API allows developers to capture custom user data that enriches user profiles for search, filtering, segmentation, and analytics. Unlike `setIdentity` which links a session to a known user ID, `setProperties` with `type: 'user'` lets you add or update attributes about **any** user - including anonymous users.\n\n> **Important**: Every new browser\u002Fdevice starts as an anonymous user, tracked via the `fs_uid` first-party cookie (1-year expiry). You can set user properties on anonymous users _before_ they ever identify. These properties persist across sessions and transfer when\u002Fif the user later identifies via `setIdentity`.\n\nKey use cases:\n\n- **Anonymous User Enrichment**: Add attributes before the user logs in (referral source, landing page, visitor type)\n- **Progressive Profiling**: Update properties as you learn more about the user\n- **Subscription\u002FPlan Changes**: Track plan upgrades without re-identifying\n- **Preference Tracking**: Store user settings and preferences\n- **CRM Sync**: Mirror key CRM fields in Fullstory\n\n## Core Concepts\n\n### setIdentity vs setProperties\n\n| API                    | Purpose                                                       | When to Use                                            | Works for Anonymous?                 |\n| ---------------------- | ------------------------------------------------------------- | ------------------------------------------------------ | ------------------------------------ |\n| `setIdentity`          | Link session to a known user ID + optional initial properties | Login, authentication                                  | No (converts anonymous → identified) |\n| `setProperties` (user) | Add\u002Fupdate properties for the current user                    | **Anytime** - works for anonymous AND identified users | **Yes** ✅                           |\n\n> **Key Distinction**: Use `setIdentity` when you need to **link a session to a known user** (requires a `uid`). Use `setProperties` when you just want to **add or update attributes** about the current user - this works for both identified AND anonymous users.\n\n### Anonymous Users in Fullstory\n\nEvery user starts as anonymous, tracked via the `fs_uid` first-party cookie:\n\n- **Cookie-based identity**: Fullstory sets an `fs_uid` cookie (1-year expiry) that tracks the same anonymous user across sessions and page views\n- **Persistent across sessions**: As long as the cookie exists, all sessions are linked to the same anonymous user\n- **Can receive user properties**: Use `setProperties` to add attributes to anonymous users\n- **Properties transfer on identification**: When `setIdentity` is called, ALL previous sessions (linked by the cookie) merge into the identified user\n- **Searchable and segmentable**: Anonymous users work just like identified users in Fullstory\n\n> **Reference**: [Why Fullstory uses First-Party Cookies](https:\u002F\u002Fhelp.fullstory.com\u002Fhc\u002Fen-us\u002Farticles\u002F360020829513-Why-Fullstory-uses-First-Party-Cookies)\n\n```javascript\n\u002F\u002F User lands on your site (anonymous - \"User 4521\" in Fullstory)\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    landing_page: '\u002Fpricing',\n    referral_source: 'google_ads',\n    campaign: 'spring_sale_2024',\n  },\n})\n\n\u002F\u002F ... user browses for a while ...\n\n\u002F\u002F Later, user creates an account and logs in\nFS('setIdentity', {\n  uid: 'user_abc123',\n  properties: {\n    displayName: 'Jane Smith',\n    email: 'jane@example.com',\n  },\n})\n\u002F\u002F The anonymous properties (landing_page, referral_source, campaign)\n\u002F\u002F are now attached to the identified user \"Jane Smith\"\n```\n\n### When to Use Each\n\n```\nUser logs in → setIdentity({ uid: \"user_123\", properties: { displayName: \"Jane\" } })\n                ↓\nUser updates profile → setProperties({ type: 'user', properties: { plan: \"pro\" } })\n                ↓\nUser upgrades plan → setProperties({ type: 'user', properties: { plan: \"enterprise\" } })\n```\n\n**For anonymous users** (not yet logged in):\n\n```javascript\n\u002F\u002F User hasn't logged in yet, but we know something about them\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    visitor_type: 'returning',\n    referral_source: 'google_ads',\n    landing_page: '\u002Fpricing',\n  },\n})\n\u002F\u002F These properties will be associated with the anonymous user\n\u002F\u002F and will persist if\u002Fwhen they later identify\n```\n\n### Property Persistence\n\n- User properties persist across sessions\n- Properties can be updated at any time\n- New properties are added; existing properties are overwritten\n- Properties cannot be deleted via the API (contact support)\n\n### Special Fields\n\n| Field         | Behavior                                            |\n| ------------- | --------------------------------------------------- |\n| `displayName` | Shown in session list and user card in Fullstory UI |\n| `email`       | Enables email-based search and HTTP API lookups     |\n\n---\n\n## API Reference\n\n### Basic Syntax\n\n```javascript\nFS('setProperties', {\n  type: 'user',\n  properties: object,     \u002F\u002F Required: Key\u002Fvalue pairs\n  schema?: object         \u002F\u002F Optional: Type hints\n});\n```\n\n### Parameters\n\n| Parameter    | Type   | Required | Description                            |\n| ------------ | ------ | -------- | -------------------------------------- |\n| `type`       | string | **Yes**  | Must be `'user'` for user properties   |\n| `properties` | object | **Yes**  | Key\u002Fvalue pairs of user data           |\n| `schema`     | object | No       | Explicit type inference for properties |\n\n### Supported Property Types\n\n| Type    | Description       | Examples                     |\n| ------- | ----------------- | ---------------------------- |\n| `str`   | String value      | \"premium\", \"enterprise\"      |\n| `strs`  | Array of strings  | [\"admin\", \"beta-tester\"]     |\n| `int`   | Integer           | 42, -5, 0                    |\n| `ints`  | Array of integers | [1, 2, 3]                    |\n| `real`  | Float\u002Fdecimal     | 99.99, -3.14                 |\n| `reals` | Array of reals    | [10.5, 20.0]                 |\n| `bool`  | Boolean           | true, false                  |\n| `bools` | Array of booleans | [true, false, true]          |\n| `date`  | ISO8601 date      | \"2024-01-15T00:00:00Z\"       |\n| `dates` | Array of dates    | [\"2024-01-01\", \"2024-02-01\"] |\n\n### Rate Limits\n\n- **Sustained**: 30 calls per page per minute\n- **Burst**: 10 calls per second\n\n---\n\n## ✅ GOOD IMPLEMENTATION EXAMPLES\n\n### Example 1: Post-Identification Profile Enrichment\n\n```javascript\n\u002F\u002F GOOD: Add properties after initial identification\n\u002F\u002F Step 1: Identify user on login (minimal properties)\nFS('setIdentity', {\n  uid: user.id,\n  properties: {\n    displayName: user.name,\n    email: user.email,\n  },\n})\n\n\u002F\u002F Step 2: Enrich with additional data once loaded\nasync function loadUserProfile() {\n  const profile = await fetchUserProfile(user.id)\n\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      companyName: profile.company.name,\n      companySize: profile.company.employeeCount,\n      industry: profile.company.industry,\n      role: profile.role,\n      department: profile.department,\n      signupSource: profile.attribution.source,\n      referralCode: profile.attribution.referralCode,\n    },\n  })\n}\n```\n\n**Why this is good:**\n\n- ✅ Quick identification on login (doesn't block on profile load)\n- ✅ Rich data added once available\n- ✅ Clean separation of concerns\n- ✅ Properties available for segmentation\n\n### Example 2: Subscription\u002FPlan Updates\n\n```javascript\n\u002F\u002F GOOD: Track subscription changes without re-identifying\nasync function handlePlanUpgrade(newPlan) {\n  \u002F\u002F Process the upgrade\n  await processUpgrade(newPlan)\n\n  \u002F\u002F Update user properties to reflect new plan\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      plan: newPlan.name,\n      planTier: newPlan.tier,\n      monthlyPrice: newPlan.price,\n      billingCycle: newPlan.billingCycle,\n      planChangedAt: new Date().toISOString(),\n      previousPlan: getCurrentPlan().name,\n    },\n    schema: {\n      monthlyPrice: 'real',\n      planChangedAt: 'date',\n    },\n  })\n\n  \u002F\u002F Also track as an event for funnel analysis\n  FS('trackEvent', {\n    name: 'Plan Upgraded',\n    properties: {\n      fromPlan: getCurrentPlan().name,\n      toPlan: newPlan.name,\n      priceDifference: newPlan.price - getCurrentPlan().price,\n    },\n  })\n}\n```\n\n**Why this is good:**\n\n- ✅ Updates user properties without re-identification\n- ✅ Tracks both current state (property) and change (event)\n- ✅ Uses schema for proper type handling\n- ✅ Captures before\u002Fafter for analysis\n\n### Example 3: Progressive Profiling (Onboarding)\n\n```javascript\n\u002F\u002F GOOD: Build up user profile through onboarding steps\nclass OnboardingFlow {\n  \u002F\u002F Step 1: Basic info collected\n  completeBasicInfo(data) {\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        companyName: data.companyName,\n        companySize: data.companySize,\n        onboardingStep: 1,\n        onboardingStartedAt: new Date().toISOString(),\n      },\n      schema: {\n        onboardingStep: 'int',\n        onboardingStartedAt: 'date',\n      },\n    })\n  }\n\n  \u002F\u002F Step 2: Use case selection\n  completeUseCaseSelection(useCases) {\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        primaryUseCase: useCases.primary,\n        secondaryUseCases: useCases.secondary, \u002F\u002F Array of strings\n        onboardingStep: 2,\n      },\n      schema: {\n        secondaryUseCases: 'strs',\n        onboardingStep: 'int',\n      },\n    })\n  }\n\n  \u002F\u002F Step 3: Integration setup\n  completeIntegrationSetup(integrations) {\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        connectedIntegrations: integrations.connected,\n        integrationCount: integrations.connected.length,\n        onboardingStep: 3,\n      },\n      schema: {\n        connectedIntegrations: 'strs',\n        integrationCount: 'int',\n        onboardingStep: 'int',\n      },\n    })\n  }\n\n  \u002F\u002F Final step: Mark complete\n  completeOnboarding() {\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        onboardingComplete: true,\n        onboardingCompletedAt: new Date().toISOString(),\n        onboardingStep: 4,\n      },\n      schema: {\n        onboardingComplete: 'bool',\n        onboardingCompletedAt: 'date',\n        onboardingStep: 'int',\n      },\n    })\n  }\n}\n```\n\n**Why this is good:**\n\n- ✅ Builds profile incrementally\n- ✅ Each step adds relevant properties\n- ✅ Tracks progress via onboardingStep\n- ✅ Enables segment analysis of drop-off points\n\n### Example 4: Feature Usage Tracking\n\n```javascript\n\u002F\u002F GOOD: Track feature adoption at user level\nclass FeatureUsageTracker {\n  trackFeatureFirstUse(featureName) {\n    const propertyName = `firstUsed_${featureName}`\n\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        [propertyName]: new Date().toISOString(),\n      },\n      schema: {\n        [propertyName]: 'date',\n      },\n    })\n  }\n\n  updateFeatureEngagement(features) {\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        featuresUsed: features.used,\n        mostUsedFeature: features.mostUsed,\n        featureUsageScore: features.engagementScore,\n        lastActiveFeature: features.lastUsed,\n        lastFeatureUseAt: new Date().toISOString(),\n      },\n      schema: {\n        featuresUsed: 'strs',\n        featureUsageScore: 'int',\n        lastFeatureUseAt: 'date',\n      },\n    })\n  }\n}\n\n\u002F\u002F Usage\nconst tracker = new FeatureUsageTracker()\ntracker.trackFeatureFirstUse('advanced_export')\ntracker.updateFeatureEngagement({\n  used: ['dashboard', 'reports', 'advanced_export'],\n  mostUsed: 'reports',\n  engagementScore: 85,\n  lastUsed: 'advanced_export',\n})\n```\n\n**Why this is good:**\n\n- ✅ Tracks feature adoption dates\n- ✅ Maintains engagement metrics\n- ✅ Enables feature-based segmentation\n- ✅ Supports adoption analysis\n\n### Example 5: CRM Data Sync\n\n```javascript\n\u002F\u002F GOOD: Sync key CRM fields to Fullstory\nasync function syncCRMData(userId) {\n  const crmData = await fetchFromCRM(userId)\n\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      \u002F\u002F Sales\u002FAccount info\n      accountOwner: crmData.owner.name,\n      accountStage: crmData.stage,\n      dealValue: crmData.opportunity.value,\n      closeDate: crmData.opportunity.expectedClose,\n\n      \u002F\u002F Health metrics\n      healthScore: crmData.health.score,\n      churnRisk: crmData.health.churnRisk,\n      npsScore: crmData.health.nps,\n\n      \u002F\u002F Engagement\n      lastContactDate: crmData.lastContact,\n      meetingsScheduled: crmData.meetings.scheduled,\n      supportTicketsOpen: crmData.support.openTickets,\n\n      \u002F\u002F Sync metadata\n      crmSyncedAt: new Date().toISOString(),\n    },\n    schema: {\n      dealValue: 'real',\n      closeDate: 'date',\n      healthScore: 'int',\n      churnRisk: 'real',\n      npsScore: 'int',\n      lastContactDate: 'date',\n      meetingsScheduled: 'int',\n      supportTicketsOpen: 'int',\n      crmSyncedAt: 'date',\n    },\n  })\n}\n```\n\n**Why this is good:**\n\n- ✅ Bridges CRM and product analytics\n- ✅ Enables sales context in session replay\n- ✅ Supports health-based segmentation\n- ✅ Tracks sync time for data freshness\n\n---\n\n## ❌ BAD IMPLEMENTATION EXAMPLES\n\n### Example 1: Using setProperties Instead of setIdentity\n\n```javascript\n\u002F\u002F BAD: Trying to use setProperties for initial identification\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    uid: user.id, \u002F\u002F This won't work!\n    displayName: user.name,\n    email: user.email,\n  },\n})\n```\n\n**Why this is bad:**\n\n- ❌ setProperties doesn't establish identity\n- ❌ uid as a property doesn't link sessions\n- ❌ User remains anonymous\n- ❌ Misunderstanding of API purpose\n\n**CORRECTED VERSION:**\n\n```javascript\n\u002F\u002F GOOD: Use setIdentity for identification\nFS('setIdentity', {\n  uid: user.id,\n  properties: {\n    displayName: user.name,\n    email: user.email,\n  },\n})\n```\n\n### Example 2: Calling Before Identification\n\n```javascript\n\u002F\u002F BAD: Setting user properties before user is identified\nfunction updateUserPreferences(preferences) {\n  \u002F\u002F This won't persist properly if user is anonymous!\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      theme: preferences.theme,\n      language: preferences.language,\n    },\n  })\n}\n```\n\n**Why this is bad:**\n\n- ❌ Properties on anonymous users are session-scoped\n- ❌ Data won't persist across sessions\n- ❌ Can't segment by these properties reliably\n\n**CORRECTED VERSION:**\n\n```javascript\n\u002F\u002F GOOD: Check identification status first\nfunction updateUserPreferences(preferences) {\n  \u002F\u002F Only set user properties if identified\n  if (isUserIdentified()) {\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        theme: preferences.theme,\n        language: preferences.language,\n      },\n    })\n  }\n  \u002F\u002F For anonymous users, consider page properties or just skip\n}\n```\n\n### Example 3: Excessive Calls\n\n```javascript\n\u002F\u002F BAD: Calling setProperties too frequently\nfunction handleFormFieldChange(fieldName, value) {\n  \u002F\u002F BAD: This fires on every keystroke!\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      [`form_${fieldName}`]: value,\n    },\n  })\n}\n```\n\n**Why this is bad:**\n\n- ❌ Will hit rate limits (30\u002Fmin, 10\u002Fsec)\n- ❌ Wastes API calls on intermediate states\n- ❌ Transient form data isn't good for user properties\n\n**CORRECTED VERSION:**\n\n```javascript\n\u002F\u002F GOOD: Batch updates on form submission\nfunction handleFormSubmit(formData) {\n  \u002F\u002F Set meaningful final values\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      preferredContact: formData.contactMethod,\n      marketingOptIn: formData.optIn,\n      timezone: formData.timezone,\n    },\n  })\n\n  \u002F\u002F Track the form submission as event\n  FS('trackEvent', {\n    name: 'Preferences Updated',\n    properties: formData,\n  })\n}\n```\n\n### Example 4: Wrong Type for Properties\n\n```javascript\n\u002F\u002F BAD: Missing type parameter\nFS('setProperties', {\n  properties: {\n    plan: 'premium',\n  },\n  \u002F\u002F Missing type: 'user'!\n})\n```\n\n**Why this is bad:**\n\n- ❌ Missing required `type` parameter\n- ❌ API call will fail or behave unexpectedly\n- ❌ Easy to miss in testing\n\n**CORRECTED VERSION:**\n\n```javascript\n\u002F\u002F GOOD: Include type parameter\nFS('setProperties', {\n  type: 'user', \u002F\u002F Required!\n  properties: {\n    plan: 'premium',\n  },\n})\n```\n\n### Example 5: Type Mismatches\n\n```javascript\n\u002F\u002F BAD: Incorrect value formats\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    accountBalance: '$1,234.56', \u002F\u002F BAD: Formatted currency\n    loginCount: 'forty-two', \u002F\u002F BAD: Written number\n    isPremium: 'yes', \u002F\u002F BAD: String instead of boolean\n    signupDate: 'January 15, 2024', \u002F\u002F BAD: Not ISO8601\n  },\n  schema: {\n    accountBalance: 'real',\n    loginCount: 'int',\n    isPremium: 'bool',\n    signupDate: 'date',\n  },\n})\n```\n\n**Why this is bad:**\n\n- ❌ Values don't match declared types\n- ❌ Parsing will fail\n- ❌ Properties won't be queryable correctly\n\n**CORRECTED VERSION:**\n\n```javascript\n\u002F\u002F GOOD: Properly formatted values\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    accountBalance: 1234.56,\n    currency: 'USD', \u002F\u002F Separate field for formatting\n    loginCount: 42,\n    isPremium: true,\n    signupDate: '2024-01-15T00:00:00Z',\n  },\n  schema: {\n    accountBalance: 'real',\n    loginCount: 'int',\n    isPremium: 'bool',\n    signupDate: 'date',\n  },\n})\n```\n\n### Example 6: Overwriting Important Properties\n\n```javascript\n\u002F\u002F BAD: Carelessly overwriting displayName\nfunction updateLastActivity() {\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      displayName: 'Active User', \u002F\u002F BAD: Overwrites the real name!\n      lastActivityAt: new Date().toISOString(),\n    },\n  })\n}\n```\n\n**Why this is bad:**\n\n- ❌ Overwrites displayName with generic value\n- ❌ Loses actual user name in Fullstory UI\n- ❌ Makes sessions hard to identify\n\n**CORRECTED VERSION:**\n\n```javascript\n\u002F\u002F GOOD: Only update intended properties\nfunction updateLastActivity() {\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      lastActivityAt: new Date().toISOString(),\n      isRecentlyActive: true,\n    },\n    schema: {\n      lastActivityAt: 'date',\n      isRecentlyActive: 'bool',\n    },\n  })\n}\n```\n\n---\n\n## COMMON IMPLEMENTATION PATTERNS\n\n### Pattern 1: Property Manager Class\n\n```javascript\n\u002F\u002F Centralized user property management\nclass UserPropertyManager {\n  constructor() {\n    this.pendingProperties = {}\n    this.flushTimeout = null\n  }\n\n  \u002F\u002F Queue properties for batched update\n  queue(properties, schema = {}) {\n    Object.assign(this.pendingProperties, properties)\n\n    \u002F\u002F Debounce to batch rapid updates\n    if (this.flushTimeout) clearTimeout(this.flushTimeout)\n    this.flushTimeout = setTimeout(() => this.flush(), 1000)\n  }\n\n  \u002F\u002F Immediately send properties\n  flush() {\n    if (Object.keys(this.pendingProperties).length === 0) return\n\n    FS('setProperties', {\n      type: 'user',\n      properties: this.pendingProperties,\n    })\n\n    this.pendingProperties = {}\n    this.flushTimeout = null\n  }\n\n  \u002F\u002F Update specific category of properties\n  updateEngagement(data) {\n    this.queue({\n      lastActiveAt: new Date().toISOString(),\n      sessionCount: data.sessionCount,\n      pageViewsTotal: data.pageViews,\n    })\n  }\n\n  updateSubscription(plan) {\n    \u002F\u002F Subscription updates are important - flush immediately\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        plan: plan.name,\n        planTier: plan.tier,\n        planUpdatedAt: new Date().toISOString(),\n      },\n    })\n  }\n}\n```\n\n### Pattern 2: Property Sync on Page Load\n\n```javascript\n\u002F\u002F Sync important properties on each page load\nasync function syncUserProperties() {\n  const user = await getCurrentUser()\n  if (!user) return\n\n  \u002F\u002F Fetch latest data\n  const [profile, subscription, usage] = await Promise.all([\n    fetchProfile(user.id),\n    fetchSubscription(user.id),\n    fetchUsageStats(user.id),\n  ])\n\n  \u002F\u002F Sync to Fullstory\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      \u002F\u002F Profile\n      displayName: profile.fullName,\n      email: profile.email,\n      role: profile.role,\n\n      \u002F\u002F Subscription\n      plan: subscription.plan,\n      planStatus: subscription.status,\n      mrr: subscription.mrr,\n\n      \u002F\u002F Usage\n      lastLoginAt: usage.lastLogin,\n      totalLogins: usage.loginCount,\n      daysActive: usage.activeDays,\n    },\n    schema: {\n      mrr: 'real',\n      lastLoginAt: 'date',\n      totalLogins: 'int',\n      daysActive: 'int',\n    },\n  })\n}\n\n\u002F\u002F Run on app initialization\ninitApp().then(syncUserProperties)\n```\n\n### Pattern 3: Event-Driven Property Updates\n\n```javascript\n\u002F\u002F Update properties based on key events\nconst eventPropertyMap = {\n  trial_started: (event) => ({\n    trialStartedAt: new Date().toISOString(),\n    trialPlan: event.plan,\n    isTrialing: true,\n  }),\n\n  trial_converted: (event) => ({\n    trialConvertedAt: new Date().toISOString(),\n    isTrialing: false,\n    isPaying: true,\n    plan: event.plan,\n  }),\n\n  trial_expired: (event) => ({\n    trialExpiredAt: new Date().toISOString(),\n    isTrialing: false,\n    isPaying: false,\n  }),\n\n  feature_enabled: (event) => ({\n    [`feature_${event.feature}_enabled`]: true,\n    [`feature_${event.feature}_enabledAt`]: new Date().toISOString(),\n  }),\n}\n\nfunction handleBusinessEvent(eventName, eventData) {\n  \u002F\u002F Track the event\n  FS('trackEvent', {\n    name: eventName,\n    properties: eventData,\n  })\n\n  \u002F\u002F Update user properties if mapping exists\n  const propertyUpdater = eventPropertyMap[eventName]\n  if (propertyUpdater) {\n    FS('setProperties', {\n      type: 'user',\n      properties: propertyUpdater(eventData),\n    })\n  }\n}\n```\n\n---\n\n## RELATIONSHIP WITH OTHER APIs\n\n### setIdentity + setProperties Workflow\n\n```javascript\n\u002F\u002F Initial identification with core properties\nFS('setIdentity', {\n  uid: user.id,\n  properties: {\n    displayName: user.name,\n    email: user.email,\n  },\n})\n\n\u002F\u002F Later: add more properties\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    company: companyData.name,\n    role: roleData.title,\n  },\n})\n```\n\n### setProperties (user) vs setProperties (page)\n\n```javascript\n\u002F\u002F User properties: persist across sessions, about the person\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    plan: 'enterprise',\n    accountAge: 365,\n  },\n})\n\n\u002F\u002F Page properties: session-scoped, about the current context\nFS('setProperties', {\n  type: 'page',\n  properties: {\n    pageName: 'Dashboard',\n    filters: ['active', 'recent'],\n  },\n})\n```\n\n### setProperties vs trackEvent\n\n```javascript\n\u002F\u002F Properties: current state (what IS)\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    plan: 'professional',\n    seats: 10,\n  },\n})\n\n\u002F\u002F Events: actions\u002Fchanges (what HAPPENED)\nFS('trackEvent', {\n  name: 'Plan Upgraded',\n  properties: {\n    from: 'starter',\n    to: 'professional',\n    seatChange: 5,\n  },\n})\n```\n\n---\n\n## TROUBLESHOOTING\n\n### Properties Not Appearing\n\n**Symptom**: User properties don't show in Fullstory\n\n**Common Causes**:\n\n1. ❌ User not identified first\n2. ❌ Missing `type: 'user'` parameter\n3. ❌ Type mismatches in values\n4. ❌ Rate limits exceeded\n\n**Solutions**:\n\n- ✅ Ensure setIdentity called first\n- ✅ Always include `type: 'user'`\n- ✅ Use schema for explicit typing\n- ✅ Batch updates to avoid rate limits\n\n### Properties Show Wrong Values\n\n**Symptom**: Property values are incorrect or unexpected type\n\n**Common Causes**:\n\n1. ❌ Value format doesn't match schema type\n2. ❌ Formatted strings for numeric values\n3. ❌ Boolean as string (\"true\" vs true)\n\n**Solutions**:\n\n- ✅ Use clean numeric values\n- ✅ Use actual boolean types\n- ✅ Format dates as ISO8601\n- ✅ Specify schema explicitly\n\n### displayName Keeps Getting Overwritten\n\n**Symptom**: User's display name changes unexpectedly\n\n**Common Causes**:\n\n1. ❌ Multiple places setting displayName\n2. ❌ Automated scripts overwriting\n3. ❌ Race conditions in property updates\n\n**Solutions**:\n\n- ✅ Set displayName only in identification flow\n- ✅ Audit all setProperties calls\n- ✅ Use dedicated fields for other \"name\" data\n\n---\n\n## LIMITS AND CONSTRAINTS\n\n### Property Limits\n\n- Check your Fullstory plan for specific limits\n- Property names: alphanumeric, underscores, hyphens\n- Avoid high-cardinality properties\n\n### Call Frequency\n\n- **Sustained**: 30 calls per page per minute\n- **Burst**: 10 calls per second\n\n### Value Requirements\n\n- Strings: Must be valid UTF-8\n- Numbers: Standard JSON number format\n- Dates: ISO8601 format\n- Arrays: Maximum length varies by plan\n\n---\n\n## KEY TAKEAWAYS FOR AGENT\n\nWhen helping developers implement User Properties:\n\n1. **Always emphasize**:\n   - User must be identified first (setIdentity)\n   - Include `type: 'user'` parameter\n   - Use schema for non-string types\n   - Batch updates to respect rate limits\n\n2. **Common mistakes to watch for**:\n   - Missing type parameter\n   - Setting properties before identification\n   - Excessive call frequency\n   - Type mismatches in values\n   - Overwriting displayName accidentally\n\n3. **Questions to ask developers**:\n   - Will the user be anonymous or identified? (Both work - setProperties doesn't require identification)\n   - How often will these properties be updated?\n   - What data types are these values?\n   - Do you need to track the change as an event too?\n\n4. **Best practices to recommend**:\n   - Set core properties in setIdentity\n   - Use setProperties for subsequent updates\n   - Track important changes as events too\n   - Consider property batching for frequent updates\n\n---\n\n## REFERENCE LINKS\n\n- **Set User Properties**: https:\u002F\u002Fdeveloper.fullstory.com\u002Fbrowser\u002Fidentification\u002Fset-user-properties\u002F\n- **Custom Properties**: https:\u002F\u002Fdeveloper.fullstory.com\u002Fbrowser\u002Fcustom-properties\u002F\n- **Identify Users**: https:\u002F\u002Fdeveloper.fullstory.com\u002Fbrowser\u002Fidentification\u002Fidentify-users\u002F\n- **Help Center - Custom Properties**: https:\u002F\u002Fhelp.fullstory.com\u002Fhc\u002Fen-us\u002Farticles\u002F360020623234\n\n---\n\n_This skill document was created to help Agent understand and guide developers in implementing Fullstory's User Properties API correctly for web applications._","# Fullstory User Properties API\n\n## Overview\n\nFullstory's User Properties API allows developers to capture custom user data that enriches user profiles for search, filtering, segmentation, and analytics. Unlike `setIdentity` which links a session to a known user ID, `setProperties` with `type: 'user'` lets you add or update attributes about **any** user - including anonymous users.\n\n> **Important**: Every new browser\u002Fdevice starts as an anonymous user, tracked via the `fs_uid` first-party cookie (1-year expiry). You can set user properties on anonymous users _before_ they ever identify. These properties persist across sessions and transfer when\u002Fif the user later identifies via `setIdentity`.\n\nKey use cases:\n\n- **Anonymous User Enrichment**: Add attributes before the user logs in (referral source, landing page, visitor type)\n- **Progressive Profiling**: Update properties as you learn more about the user\n- **Subscription\u002FPlan Changes**: Track plan upgrades without re-identifying\n- **Preference Tracking**: Store user settings and preferences\n- **CRM Sync**: Mirror key CRM fields in Fullstory\n\n## Core Concepts\n\n### setIdentity vs setProperties\n\n| API                    | Purpose                                                       | When to Use                                            | Works for Anonymous?                 |\n| ---------------------- | ------------------------------------------------------------- | ------------------------------------------------------ | ------------------------------------ |\n| `setIdentity`          | Link session to a known user ID + optional initial properties | Login, authentication                                  | No (converts anonymous → identified) |\n| `setProperties` (user) | Add\u002Fupdate properties for the current user                    | **Anytime** - works for anonymous AND identified users | **Yes** ✅                           |\n\n> **Key Distinction**: Use `setIdentity` when you need to **link a session to a known user** (requires a `uid`). Use `setProperties` when you just want to **add or update attributes** about the current user - this works for both identified AND anonymous users.\n\n### Anonymous Users in Fullstory\n\nEvery user starts as anonymous, tracked via the `fs_uid` first-party cookie:\n\n- **Cookie-based identity**: Fullstory sets an `fs_uid` cookie (1-year expiry) that tracks the same anonymous user across sessions and page views\n- **Persistent across sessions**: As long as the cookie exists, all sessions are linked to the same anonymous user\n- **Can receive user properties**: Use `setProperties` to add attributes to anonymous users\n- **Properties transfer on identification**: When `setIdentity` is called, ALL previous sessions (linked by the cookie) merge into the identified user\n- **Searchable and segmentable**: Anonymous users work just like identified users in Fullstory\n\n> **Reference**: [Why Fullstory uses First-Party Cookies](https:\u002F\u002Fhelp.fullstory.com\u002Fhc\u002Fen-us\u002Farticles\u002F360020829513-Why-Fullstory-uses-First-Party-Cookies)\n\n```javascript\n\u002F\u002F User lands on your site (anonymous - \"User 4521\" in Fullstory)\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    landing_page: '\u002Fpricing',\n    referral_source: 'google_ads',\n    campaign: 'spring_sale_2024',\n  },\n})\n\n\u002F\u002F ... user browses for a while ...\n\n\u002F\u002F Later, user creates an account and logs in\nFS('setIdentity', {\n  uid: 'user_abc123',\n  properties: {\n    displayName: 'Jane Smith',\n    email: 'jane@example.com',\n  },\n})\n\u002F\u002F The anonymous properties (landing_page, referral_source, campaign)\n\u002F\u002F are now attached to the identified user \"Jane Smith\"\n```\n\n### When to Use Each\n\n```\nUser logs in → setIdentity({ uid: \"user_123\", properties: { displayName: \"Jane\" } })\n                ↓\nUser updates profile → setProperties({ type: 'user', properties: { plan: \"pro\" } })\n                ↓\nUser upgrades plan → setProperties({ type: 'user', properties: { plan: \"enterprise\" } })\n```\n\n**For anonymous users** (not yet logged in):\n\n```javascript\n\u002F\u002F User hasn't logged in yet, but we know something about them\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    visitor_type: 'returning',\n    referral_source: 'google_ads',\n    landing_page: '\u002Fpricing',\n  },\n})\n\u002F\u002F These properties will be associated with the anonymous user\n\u002F\u002F and will persist if\u002Fwhen they later identify\n```\n\n### Property Persistence\n\n- User properties persist across sessions\n- Properties can be updated at any time\n- New properties are added; existing properties are overwritten\n- Properties cannot be deleted via the API (contact support)\n\n### Special Fields\n\n| Field         | Behavior                                            |\n| ------------- | --------------------------------------------------- |\n| `displayName` | Shown in session list and user card in Fullstory UI |\n| `email`       | Enables email-based search and HTTP API lookups     |\n\n---\n\n## API Reference\n\n### Basic Syntax\n\n```javascript\nFS('setProperties', {\n  type: 'user',\n  properties: object,     \u002F\u002F Required: Key\u002Fvalue pairs\n  schema?: object         \u002F\u002F Optional: Type hints\n});\n```\n\n### Parameters\n\n| Parameter    | Type   | Required | Description                            |\n| ------------ | ------ | -------- | -------------------------------------- |\n| `type`       | string | **Yes**  | Must be `'user'` for user properties   |\n| `properties` | object | **Yes**  | Key\u002Fvalue pairs of user data           |\n| `schema`     | object | No       | Explicit type inference for properties |\n\n### Supported Property Types\n\n| Type    | Description       | Examples                     |\n| ------- | ----------------- | ---------------------------- |\n| `str`   | String value      | \"premium\", \"enterprise\"      |\n| `strs`  | Array of strings  | [\"admin\", \"beta-tester\"]     |\n| `int`   | Integer           | 42, -5, 0                    |\n| `ints`  | Array of integers | [1, 2, 3]                    |\n| `real`  | Float\u002Fdecimal     | 99.99, -3.14                 |\n| `reals` | Array of reals    | [10.5, 20.0]                 |\n| `bool`  | Boolean           | true, false                  |\n| `bools` | Array of booleans | [true, false, true]          |\n| `date`  | ISO8601 date      | \"2024-01-15T00:00:00Z\"       |\n| `dates` | Array of dates    | [\"2024-01-01\", \"2024-02-01\"] |\n\n### Rate Limits\n\n- **Sustained**: 30 calls per page per minute\n- **Burst**: 10 calls per second\n\n---\n\n## ✅ GOOD IMPLEMENTATION EXAMPLES\n\n### Example 1: Post-Identification Profile Enrichment\n\n```javascript\n\u002F\u002F GOOD: Add properties after initial identification\n\u002F\u002F Step 1: Identify user on login (minimal properties)\nFS('setIdentity', {\n  uid: user.id,\n  properties: {\n    displayName: user.name,\n    email: user.email,\n  },\n})\n\n\u002F\u002F Step 2: Enrich with additional data once loaded\nasync function loadUserProfile() {\n  const profile = await fetchUserProfile(user.id)\n\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      companyName: profile.company.name,\n      companySize: profile.company.employeeCount,\n      industry: profile.company.industry,\n      role: profile.role,\n      department: profile.department,\n      signupSource: profile.attribution.source,\n      referralCode: profile.attribution.referralCode,\n    },\n  })\n}\n```\n\n**Why this is good:**\n\n- ✅ Quick identification on login (doesn't block on profile load)\n- ✅ Rich data added once available\n- ✅ Clean separation of concerns\n- ✅ Properties available for segmentation\n\n### Example 2: Subscription\u002FPlan Updates\n\n```javascript\n\u002F\u002F GOOD: Track subscription changes without re-identifying\nasync function handlePlanUpgrade(newPlan) {\n  \u002F\u002F Process the upgrade\n  await processUpgrade(newPlan)\n\n  \u002F\u002F Update user properties to reflect new plan\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      plan: newPlan.name,\n      planTier: newPlan.tier,\n      monthlyPrice: newPlan.price,\n      billingCycle: newPlan.billingCycle,\n      planChangedAt: new Date().toISOString(),\n      previousPlan: getCurrentPlan().name,\n    },\n    schema: {\n      monthlyPrice: 'real',\n      planChangedAt: 'date',\n    },\n  })\n\n  \u002F\u002F Also track as an event for funnel analysis\n  FS('trackEvent', {\n    name: 'Plan Upgraded',\n    properties: {\n      fromPlan: getCurrentPlan().name,\n      toPlan: newPlan.name,\n      priceDifference: newPlan.price - getCurrentPlan().price,\n    },\n  })\n}\n```\n\n**Why this is good:**\n\n- ✅ Updates user properties without re-identification\n- ✅ Tracks both current state (property) and change (event)\n- ✅ Uses schema for proper type handling\n- ✅ Captures before\u002Fafter for analysis\n\n### Example 3: Progressive Profiling (Onboarding)\n\n```javascript\n\u002F\u002F GOOD: Build up user profile through onboarding steps\nclass OnboardingFlow {\n  \u002F\u002F Step 1: Basic info collected\n  completeBasicInfo(data) {\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        companyName: data.companyName,\n        companySize: data.companySize,\n        onboardingStep: 1,\n        onboardingStartedAt: new Date().toISOString(),\n      },\n      schema: {\n        onboardingStep: 'int',\n        onboardingStartedAt: 'date',\n      },\n    })\n  }\n\n  \u002F\u002F Step 2: Use case selection\n  completeUseCaseSelection(useCases) {\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        primaryUseCase: useCases.primary,\n        secondaryUseCases: useCases.secondary, \u002F\u002F Array of strings\n        onboardingStep: 2,\n      },\n      schema: {\n        secondaryUseCases: 'strs',\n        onboardingStep: 'int',\n      },\n    })\n  }\n\n  \u002F\u002F Step 3: Integration setup\n  completeIntegrationSetup(integrations) {\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        connectedIntegrations: integrations.connected,\n        integrationCount: integrations.connected.length,\n        onboardingStep: 3,\n      },\n      schema: {\n        connectedIntegrations: 'strs',\n        integrationCount: 'int',\n        onboardingStep: 'int',\n      },\n    })\n  }\n\n  \u002F\u002F Final step: Mark complete\n  completeOnboarding() {\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        onboardingComplete: true,\n        onboardingCompletedAt: new Date().toISOString(),\n        onboardingStep: 4,\n      },\n      schema: {\n        onboardingComplete: 'bool',\n        onboardingCompletedAt: 'date',\n        onboardingStep: 'int',\n      },\n    })\n  }\n}\n```\n\n**Why this is good:**\n\n- ✅ Builds profile incrementally\n- ✅ Each step adds relevant properties\n- ✅ Tracks progress via onboardingStep\n- ✅ Enables segment analysis of drop-off points\n\n### Example 4: Feature Usage Tracking\n\n```javascript\n\u002F\u002F GOOD: Track feature adoption at user level\nclass FeatureUsageTracker {\n  trackFeatureFirstUse(featureName) {\n    const propertyName = `firstUsed_${featureName}`\n\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        [propertyName]: new Date().toISOString(),\n      },\n      schema: {\n        [propertyName]: 'date',\n      },\n    })\n  }\n\n  updateFeatureEngagement(features) {\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        featuresUsed: features.used,\n        mostUsedFeature: features.mostUsed,\n        featureUsageScore: features.engagementScore,\n        lastActiveFeature: features.lastUsed,\n        lastFeatureUseAt: new Date().toISOString(),\n      },\n      schema: {\n        featuresUsed: 'strs',\n        featureUsageScore: 'int',\n        lastFeatureUseAt: 'date',\n      },\n    })\n  }\n}\n\n\u002F\u002F Usage\nconst tracker = new FeatureUsageTracker()\ntracker.trackFeatureFirstUse('advanced_export')\ntracker.updateFeatureEngagement({\n  used: ['dashboard', 'reports', 'advanced_export'],\n  mostUsed: 'reports',\n  engagementScore: 85,\n  lastUsed: 'advanced_export',\n})\n```\n\n**Why this is good:**\n\n- ✅ Tracks feature adoption dates\n- ✅ Maintains engagement metrics\n- ✅ Enables feature-based segmentation\n- ✅ Supports adoption analysis\n\n### Example 5: CRM Data Sync\n\n```javascript\n\u002F\u002F GOOD: Sync key CRM fields to Fullstory\nasync function syncCRMData(userId) {\n  const crmData = await fetchFromCRM(userId)\n\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      \u002F\u002F Sales\u002FAccount info\n      accountOwner: crmData.owner.name,\n      accountStage: crmData.stage,\n      dealValue: crmData.opportunity.value,\n      closeDate: crmData.opportunity.expectedClose,\n\n      \u002F\u002F Health metrics\n      healthScore: crmData.health.score,\n      churnRisk: crmData.health.churnRisk,\n      npsScore: crmData.health.nps,\n\n      \u002F\u002F Engagement\n      lastContactDate: crmData.lastContact,\n      meetingsScheduled: crmData.meetings.scheduled,\n      supportTicketsOpen: crmData.support.openTickets,\n\n      \u002F\u002F Sync metadata\n      crmSyncedAt: new Date().toISOString(),\n    },\n    schema: {\n      dealValue: 'real',\n      closeDate: 'date',\n      healthScore: 'int',\n      churnRisk: 'real',\n      npsScore: 'int',\n      lastContactDate: 'date',\n      meetingsScheduled: 'int',\n      supportTicketsOpen: 'int',\n      crmSyncedAt: 'date',\n    },\n  })\n}\n```\n\n**Why this is good:**\n\n- ✅ Bridges CRM and product analytics\n- ✅ Enables sales context in session replay\n- ✅ Supports health-based segmentation\n- ✅ Tracks sync time for data freshness\n\n---\n\n## ❌ BAD IMPLEMENTATION EXAMPLES\n\n### Example 1: Using setProperties Instead of setIdentity\n\n```javascript\n\u002F\u002F BAD: Trying to use setProperties for initial identification\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    uid: user.id, \u002F\u002F This won't work!\n    displayName: user.name,\n    email: user.email,\n  },\n})\n```\n\n**Why this is bad:**\n\n- ❌ setProperties doesn't establish identity\n- ❌ uid as a property doesn't link sessions\n- ❌ User remains anonymous\n- ❌ Misunderstanding of API purpose\n\n**CORRECTED VERSION:**\n\n```javascript\n\u002F\u002F GOOD: Use setIdentity for identification\nFS('setIdentity', {\n  uid: user.id,\n  properties: {\n    displayName: user.name,\n    email: user.email,\n  },\n})\n```\n\n### Example 2: Calling Before Identification\n\n```javascript\n\u002F\u002F BAD: Setting user properties before user is identified\nfunction updateUserPreferences(preferences) {\n  \u002F\u002F This won't persist properly if user is anonymous!\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      theme: preferences.theme,\n      language: preferences.language,\n    },\n  })\n}\n```\n\n**Why this is bad:**\n\n- ❌ Properties on anonymous users are session-scoped\n- ❌ Data won't persist across sessions\n- ❌ Can't segment by these properties reliably\n\n**CORRECTED VERSION:**\n\n```javascript\n\u002F\u002F GOOD: Check identification status first\nfunction updateUserPreferences(preferences) {\n  \u002F\u002F Only set user properties if identified\n  if (isUserIdentified()) {\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        theme: preferences.theme,\n        language: preferences.language,\n      },\n    })\n  }\n  \u002F\u002F For anonymous users, consider page properties or just skip\n}\n```\n\n### Example 3: Excessive Calls\n\n```javascript\n\u002F\u002F BAD: Calling setProperties too frequently\nfunction handleFormFieldChange(fieldName, value) {\n  \u002F\u002F BAD: This fires on every keystroke!\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      [`form_${fieldName}`]: value,\n    },\n  })\n}\n```\n\n**Why this is bad:**\n\n- ❌ Will hit rate limits (30\u002Fmin, 10\u002Fsec)\n- ❌ Wastes API calls on intermediate states\n- ❌ Transient form data isn't good for user properties\n\n**CORRECTED VERSION:**\n\n```javascript\n\u002F\u002F GOOD: Batch updates on form submission\nfunction handleFormSubmit(formData) {\n  \u002F\u002F Set meaningful final values\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      preferredContact: formData.contactMethod,\n      marketingOptIn: formData.optIn,\n      timezone: formData.timezone,\n    },\n  })\n\n  \u002F\u002F Track the form submission as event\n  FS('trackEvent', {\n    name: 'Preferences Updated',\n    properties: formData,\n  })\n}\n```\n\n### Example 4: Wrong Type for Properties\n\n```javascript\n\u002F\u002F BAD: Missing type parameter\nFS('setProperties', {\n  properties: {\n    plan: 'premium',\n  },\n  \u002F\u002F Missing type: 'user'!\n})\n```\n\n**Why this is bad:**\n\n- ❌ Missing required `type` parameter\n- ❌ API call will fail or behave unexpectedly\n- ❌ Easy to miss in testing\n\n**CORRECTED VERSION:**\n\n```javascript\n\u002F\u002F GOOD: Include type parameter\nFS('setProperties', {\n  type: 'user', \u002F\u002F Required!\n  properties: {\n    plan: 'premium',\n  },\n})\n```\n\n### Example 5: Type Mismatches\n\n```javascript\n\u002F\u002F BAD: Incorrect value formats\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    accountBalance: '$1,234.56', \u002F\u002F BAD: Formatted currency\n    loginCount: 'forty-two', \u002F\u002F BAD: Written number\n    isPremium: 'yes', \u002F\u002F BAD: String instead of boolean\n    signupDate: 'January 15, 2024', \u002F\u002F BAD: Not ISO8601\n  },\n  schema: {\n    accountBalance: 'real',\n    loginCount: 'int',\n    isPremium: 'bool',\n    signupDate: 'date',\n  },\n})\n```\n\n**Why this is bad:**\n\n- ❌ Values don't match declared types\n- ❌ Parsing will fail\n- ❌ Properties won't be queryable correctly\n\n**CORRECTED VERSION:**\n\n```javascript\n\u002F\u002F GOOD: Properly formatted values\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    accountBalance: 1234.56,\n    currency: 'USD', \u002F\u002F Separate field for formatting\n    loginCount: 42,\n    isPremium: true,\n    signupDate: '2024-01-15T00:00:00Z',\n  },\n  schema: {\n    accountBalance: 'real',\n    loginCount: 'int',\n    isPremium: 'bool',\n    signupDate: 'date',\n  },\n})\n```\n\n### Example 6: Overwriting Important Properties\n\n```javascript\n\u002F\u002F BAD: Carelessly overwriting displayName\nfunction updateLastActivity() {\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      displayName: 'Active User', \u002F\u002F BAD: Overwrites the real name!\n      lastActivityAt: new Date().toISOString(),\n    },\n  })\n}\n```\n\n**Why this is bad:**\n\n- ❌ Overwrites displayName with generic value\n- ❌ Loses actual user name in Fullstory UI\n- ❌ Makes sessions hard to identify\n\n**CORRECTED VERSION:**\n\n```javascript\n\u002F\u002F GOOD: Only update intended properties\nfunction updateLastActivity() {\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      lastActivityAt: new Date().toISOString(),\n      isRecentlyActive: true,\n    },\n    schema: {\n      lastActivityAt: 'date',\n      isRecentlyActive: 'bool',\n    },\n  })\n}\n```\n\n---\n\n## COMMON IMPLEMENTATION PATTERNS\n\n### Pattern 1: Property Manager Class\n\n```javascript\n\u002F\u002F Centralized user property management\nclass UserPropertyManager {\n  constructor() {\n    this.pendingProperties = {}\n    this.flushTimeout = null\n  }\n\n  \u002F\u002F Queue properties for batched update\n  queue(properties, schema = {}) {\n    Object.assign(this.pendingProperties, properties)\n\n    \u002F\u002F Debounce to batch rapid updates\n    if (this.flushTimeout) clearTimeout(this.flushTimeout)\n    this.flushTimeout = setTimeout(() => this.flush(), 1000)\n  }\n\n  \u002F\u002F Immediately send properties\n  flush() {\n    if (Object.keys(this.pendingProperties).length === 0) return\n\n    FS('setProperties', {\n      type: 'user',\n      properties: this.pendingProperties,\n    })\n\n    this.pendingProperties = {}\n    this.flushTimeout = null\n  }\n\n  \u002F\u002F Update specific category of properties\n  updateEngagement(data) {\n    this.queue({\n      lastActiveAt: new Date().toISOString(),\n      sessionCount: data.sessionCount,\n      pageViewsTotal: data.pageViews,\n    })\n  }\n\n  updateSubscription(plan) {\n    \u002F\u002F Subscription updates are important - flush immediately\n    FS('setProperties', {\n      type: 'user',\n      properties: {\n        plan: plan.name,\n        planTier: plan.tier,\n        planUpdatedAt: new Date().toISOString(),\n      },\n    })\n  }\n}\n```\n\n### Pattern 2: Property Sync on Page Load\n\n```javascript\n\u002F\u002F Sync important properties on each page load\nasync function syncUserProperties() {\n  const user = await getCurrentUser()\n  if (!user) return\n\n  \u002F\u002F Fetch latest data\n  const [profile, subscription, usage] = await Promise.all([\n    fetchProfile(user.id),\n    fetchSubscription(user.id),\n    fetchUsageStats(user.id),\n  ])\n\n  \u002F\u002F Sync to Fullstory\n  FS('setProperties', {\n    type: 'user',\n    properties: {\n      \u002F\u002F Profile\n      displayName: profile.fullName,\n      email: profile.email,\n      role: profile.role,\n\n      \u002F\u002F Subscription\n      plan: subscription.plan,\n      planStatus: subscription.status,\n      mrr: subscription.mrr,\n\n      \u002F\u002F Usage\n      lastLoginAt: usage.lastLogin,\n      totalLogins: usage.loginCount,\n      daysActive: usage.activeDays,\n    },\n    schema: {\n      mrr: 'real',\n      lastLoginAt: 'date',\n      totalLogins: 'int',\n      daysActive: 'int',\n    },\n  })\n}\n\n\u002F\u002F Run on app initialization\ninitApp().then(syncUserProperties)\n```\n\n### Pattern 3: Event-Driven Property Updates\n\n```javascript\n\u002F\u002F Update properties based on key events\nconst eventPropertyMap = {\n  trial_started: (event) => ({\n    trialStartedAt: new Date().toISOString(),\n    trialPlan: event.plan,\n    isTrialing: true,\n  }),\n\n  trial_converted: (event) => ({\n    trialConvertedAt: new Date().toISOString(),\n    isTrialing: false,\n    isPaying: true,\n    plan: event.plan,\n  }),\n\n  trial_expired: (event) => ({\n    trialExpiredAt: new Date().toISOString(),\n    isTrialing: false,\n    isPaying: false,\n  }),\n\n  feature_enabled: (event) => ({\n    [`feature_${event.feature}_enabled`]: true,\n    [`feature_${event.feature}_enabledAt`]: new Date().toISOString(),\n  }),\n}\n\nfunction handleBusinessEvent(eventName, eventData) {\n  \u002F\u002F Track the event\n  FS('trackEvent', {\n    name: eventName,\n    properties: eventData,\n  })\n\n  \u002F\u002F Update user properties if mapping exists\n  const propertyUpdater = eventPropertyMap[eventName]\n  if (propertyUpdater) {\n    FS('setProperties', {\n      type: 'user',\n      properties: propertyUpdater(eventData),\n    })\n  }\n}\n```\n\n---\n\n## RELATIONSHIP WITH OTHER APIs\n\n### setIdentity + setProperties Workflow\n\n```javascript\n\u002F\u002F Initial identification with core properties\nFS('setIdentity', {\n  uid: user.id,\n  properties: {\n    displayName: user.name,\n    email: user.email,\n  },\n})\n\n\u002F\u002F Later: add more properties\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    company: companyData.name,\n    role: roleData.title,\n  },\n})\n```\n\n### setProperties (user) vs setProperties (page)\n\n```javascript\n\u002F\u002F User properties: persist across sessions, about the person\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    plan: 'enterprise',\n    accountAge: 365,\n  },\n})\n\n\u002F\u002F Page properties: session-scoped, about the current context\nFS('setProperties', {\n  type: 'page',\n  properties: {\n    pageName: 'Dashboard',\n    filters: ['active', 'recent'],\n  },\n})\n```\n\n### setProperties vs trackEvent\n\n```javascript\n\u002F\u002F Properties: current state (what IS)\nFS('setProperties', {\n  type: 'user',\n  properties: {\n    plan: 'professional',\n    seats: 10,\n  },\n})\n\n\u002F\u002F Events: actions\u002Fchanges (what HAPPENED)\nFS('trackEvent', {\n  name: 'Plan Upgraded',\n  properties: {\n    from: 'starter',\n    to: 'professional',\n    seatChange: 5,\n  },\n})\n```\n\n---\n\n## TROUBLESHOOTING\n\n### Properties Not Appearing\n\n**Symptom**: User properties don't show in Fullstory\n\n**Common Causes**:\n\n1. ❌ User not identified first\n2. ❌ Missing `type: 'user'` parameter\n3. ❌ Type mismatches in values\n4. ❌ Rate limits exceeded\n\n**Solutions**:\n\n- ✅ Ensure setIdentity called first\n- ✅ Always include `type: 'user'`\n- ✅ Use schema for explicit typing\n- ✅ Batch updates to avoid rate limits\n\n### Properties Show Wrong Values\n\n**Symptom**: Property values are incorrect or unexpected type\n\n**Common Causes**:\n\n1. ❌ Value format doesn't match schema type\n2. ❌ Formatted strings for numeric values\n3. ❌ Boolean as string (\"true\" vs true)\n\n**Solutions**:\n\n- ✅ Use clean numeric values\n- ✅ Use actual boolean types\n- ✅ Format dates as ISO8601\n- ✅ Specify schema explicitly\n\n### displayName Keeps Getting Overwritten\n\n**Symptom**: User's display name changes unexpectedly\n\n**Common Causes**:\n\n1. ❌ Multiple places setting displayName\n2. ❌ Automated scripts overwriting\n3. ❌ Race conditions in property updates\n\n**Solutions**:\n\n- ✅ Set displayName only in identification flow\n- ✅ Audit all setProperties calls\n- ✅ Use dedicated fields for other \"name\" data\n\n---\n\n## LIMITS AND CONSTRAINTS\n\n### Property Limits\n\n- Check your Fullstory plan for specific limits\n- Property names: alphanumeric, underscores, hyphens\n- Avoid high-cardinality properties\n\n### Call Frequency\n\n- **Sustained**: 30 calls per page per minute\n- **Burst**: 10 calls per second\n\n### Value Requirements\n\n- Strings: Must be valid UTF-8\n- Numbers: Standard JSON number format\n- Dates: ISO8601 format\n- Arrays: Maximum length varies by plan\n\n---\n\n## KEY TAKEAWAYS FOR AGENT\n\nWhen helping developers implement User Properties:\n\n1. **Always emphasize**:\n   - User must be identified first (setIdentity)\n   - Include `type: 'user'` parameter\n   - Use schema for non-string types\n   - Batch updates to respect rate limits\n\n2. **Common mistakes to watch for**:\n   - Missing type parameter\n   - Setting properties before identification\n   - Excessive call frequency\n   - Type mismatches in values\n   - Overwriting displayName accidentally\n\n3. **Questions to ask developers**:\n   - Will the user be anonymous or identified? (Both work - setProperties doesn't require identification)\n   - How often will these properties be updated?\n   - What data types are these values?\n   - Do you need to track the change as an event too?\n\n4. **Best practices to recommend**:\n   - Set core properties in setIdentity\n   - Use setProperties for subsequent updates\n   - Track important changes as events too\n   - Consider property batching for frequent updates\n\n---\n\n## REFERENCE LINKS\n\n- **Set User Properties**: https:\u002F\u002Fdeveloper.fullstory.com\u002Fbrowser\u002Fidentification\u002Fset-user-properties\u002F\n- **Custom Properties**: https:\u002F\u002Fdeveloper.fullstory.com\u002Fbrowser\u002Fcustom-properties\u002F\n- **Identify Users**: https:\u002F\u002Fdeveloper.fullstory.com\u002Fbrowser\u002Fidentification\u002Fidentify-users\u002F\n- **Help Center - Custom Properties**: https:\u002F\u002Fhelp.fullstory.com\u002Fhc\u002Fen-us\u002Farticles\u002F360020623234\n\n---\n\n_This skill document was created to help Agent understand and guide developers in implementing Fullstory's User Properties API correctly for web applications._",{"name":5,"description":7},"main","160b30f0b67c923077f886376fdfae1016a70702","experiments\u002Fdci-compare\u002Fskillrouter-skills\u002Fskill-077",2,"https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router","https:\u002F\u002Flegendtkl.github.io\u002Fagentic-skill-router\u002F","https:\u002F\u002Fgithub.com\u002Flegendtkl","http:\u002F\u002Fwww.legendtkl.com","No secret before debugging.\r\n","2026-06-04 14:02:56",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add legendtkl\u002Fagentic-skill-router --skill skill-077",{"tool":39,"command":40},"bunx","bunx skills add legendtkl\u002Fagentic-skill-router --skill skill-077",{"tool":42,"command":43},"pnpm","pnpm dlx skills add legendtkl\u002Fagentic-skill-router --skill skill-077","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Fexperiments\u002Fdci-compare\u002Fskillrouter-skills\u002Fskill-077\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":18},"01M7384EP28XVSR2R0YGRS0GK9","foo","A test skill named foo","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Ffoo\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M7384DECF306RRRC16PZJTQ5","bar","飞书 — bar with quoted Chinese","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fbar\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":18},"01M738491441AQ85E7GD7VVDTA","agentic-skill-router","First use any clearly matching enabled local\u002Fuser Agent Skill. If none matches, prefer this router for skill-shaped requests involving a named tool, API, service, CLI, platform, file format, dataset, or domain workflow, including when a generic built-in skill such as browser, Chrome, or web search also seems applicable; use built-ins directly only when explicitly requested or when the task is primarily live browsing, logged-in page operation, clicking, screenshotting, or current webpage inspection. Also use directly to audit, slim, disable, restore, or route locally installed Agent Skills across supported hosts. Examples include Vercel, Netlify, Cloudflare, Render, Playwright, Sentry, Linear, GitHub, OpenAI APIs, PDF, DOCX, PPTX, and spreadsheets.","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Fskills\u002Fagentic-skill-router\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M738475HF7SXTP4HCPZJVZ8E","syn-video-trim","Skill for trimming and cutting clips in the context of video files. Use when the user's task is specifically about trimming and cutting clips.","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Fexperiments\u002Fdci-compare\u002Fsynthetic-skills\u002Fsyn-video-trim\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M73845F4RD2AA6YHS1E3VQRB","syn-video-transcode","Skill for transcoding codecs and resolutions in the context of video files. Use when the user's task is specifically about transcoding codecs and resolutions.","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Fexperiments\u002Fdci-compare\u002Fsynthetic-skills\u002Fsyn-video-transcode\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":18},"01M73842YN17QSJETPZX6Z9DAG","syn-video-thumbnail","Skill for extracting thumbnails and frames in the context of video files. Use when the user's task is specifically about extracting thumbnails and frames.","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Fexperiments\u002Fdci-compare\u002Fsynthetic-skills\u002Fsyn-video-thumbnail\u002FSKILL.md",[],[]]