Traits

Metadata about users and groups.

Traits are metadata about users and groups — key-value pairs that describe who someone is or what a customer is like.

User traits

Set user traits with identify():

klime.identify("user_123", {
  email: "jane@acme.com",
  name: "Jane Smith",
  plan: "pro",
  role: "admin",
})

Common user traits include contact info (email, name), account info (plan, role), and custom data relevant to your business (department, signup source).

Group traits (Group mode only)

Set group traits with group():

klime.group(
  "acme_inc",
  {
    name: "Acme Inc",
    plan: "enterprise",
    employeeCount: 250,
    industry: "Technology",
  },
  { userId: "user_123" },
)

Common group traits include customer info (name, domain), business info (plan, employee count), and account details (contract dates, account manager).

Updating traits

Call identify() or group() whenever traits change. You only need to send the traits that changed:

// When user upgrades
klime.identify("user_123", { plan: "pro" })

// When company grows
klime.group("acme_inc", { employeeCount: 500 })

Supported types

Traits can be strings, numbers, booleans, or dates (as ISO 8601 strings):

{
  name: "Jane Smith",           // string
  employeeCount: 250,           // number
  emailVerified: true,          // boolean
  createdAt: "2024-01-15T10:30:00Z"  // date
}

Special traits

Klime uses two specific trait names for display and search in the UI, so make sure to always use them.

TraitUsed for
emailShown in user details, used for search
nameDisplay name for users and groups

Best practices

Use camelCase for trait names to stay consistent with JavaScript conventions.

Be consistent with naming. Pick one name for a concept and use it everywhere — don't mix plan and subscription and pricingTier.

Only track what matters. Focus on traits that help you understand customer health and engagement. Skip temporary state or preferences that don't inform business decisions.