Skip to main content

Overview

The Trodo.people object provides methods to set and manage persistent user properties. Unlike event properties (which describe a single action), user properties describe the user themselves and persist across sessions.
User properties are ideal for storing user attributes like plan type, signup date, preferences, and cumulative metrics.
This page is the API reference for Trodo.people.* methods. For how profiles are built from events and traits, see User profiles.

Method Reference

MethodDescription
people.set()Set user properties (overwrites existing)
people.set_once()Set properties only if not already set
people.increment()Increment numeric properties
people.append()Append to list properties
people.union()Add unique values to list properties
people.remove()Remove values from list properties
people.unset()Remove properties entirely
people.deleteUser()Delete the user profile
people.trackCharge()Track revenue/payment
people.clearCharges()Clear all charges

people.set()

Set user properties. Overwrites any existing values.
Trodo.people.set(properties)
properties
object
required
Object containing property key-value pairs to set.

Examples

// Set multiple properties
Trodo.people.set({
  email: '[email protected]',
  plan: 'pro',
  company: 'Acme Inc',
  signupDate: '2025-01-15'
});

// Update a single property
Trodo.people.set({
  plan: 'enterprise'
});

// Product / workspace context
Trodo.people.set({
  primary_workspace_id: 'ws_abc',
  agent_beta_opt_in: true,
  integrations_connected_count: 4
});

people.set_once()

Set properties only if they haven’t been set before. Useful for immutable properties like signup date or referral source.
Trodo.people.set_once(properties)
properties
object
required
Object containing property key-value pairs to set once.

Examples

// Only sets if not already present
Trodo.people.set_once({
  signupDate: new Date().toISOString(),
  referralSource: 'twitter',
  initialPlan: 'free'
});

// These won't overwrite existing values
Trodo.people.set_once({
  signupDate: '2025-02-01'  // Ignored if signupDate exists
});

people.increment()

Increment (or decrement) numeric properties.
Trodo.people.increment(properties)
properties
object
required
Object with property names as keys and increment amounts as values. Use negative numbers to decrement.

Examples

// Increment by 1
Trodo.people.increment({
  successful_agent_runs: 1,
  login_count: 1
});

// Increment by specific amounts
Trodo.people.increment({
  reports_generated: 3,
  api_calls_this_month: 500
});

// Decrement (use negative numbers)
Trodo.people.increment({
  creditsRemaining: -10
});

people.append()

Append values to list properties.
Trodo.people.append(properties)
properties
object
required
Object with property names as keys and values to append.

Examples

// Append to a list
Trodo.people.append({
  enabled_integrations: 'notion',
  recent_templates: 'weekly_digest'
});

// Can create duplicates
Trodo.people.append({
  recent_templates: 'crm_sync'  // Added even if already present
});

people.union()

Add unique values to list properties (no duplicates).
Trodo.people.union(properties)
properties
object
required
Object with property names as keys and arrays of values to union.

Examples

// Add unique values only
Trodo.people.union({
  enabled_integrations: ['slack', 'salesforce', 'hubspot'],
  used_features: ['agent_runs', 'scheduled_workflows']
});

// Won't add duplicates
Trodo.people.union({
  enabled_integrations: ['slack']  // Ignored if already in list
});

people.remove()

Remove specific values from list properties.
Trodo.people.remove(properties)
properties
object
required
Object with property names as keys and values to remove.

Examples

// Remove specific values from lists
Trodo.people.remove({
  enabled_integrations: 'legacy_addon',
  feature_flags: 'deprecated_ui'
});

people.unset()

Remove properties entirely from the user profile.
Trodo.people.unset(propertyNames)
propertyNames
string | string[]
required
Property name(s) to remove.

Examples

// Remove a single property
Trodo.people.unset('temporaryFlag');

// Remove multiple properties
Trodo.people.unset(['oldProperty', 'deprecatedField']);

people.deleteUser()

Permanently delete the user profile and all associated data.
Trodo.people.deleteUser()
This action is irreversible. The user’s profile and all properties will be permanently deleted.

Example

// Delete user profile (e.g., for GDPR requests)
async function handleAccountDeletion() {
  await deleteUserFromDatabase(userId);
  Trodo.people.deleteUser();
  Trodo.reset();
}

people.trackCharge()

Track a payment or revenue event associated with the user.
Trodo.people.trackCharge(amount, properties?)
amount
number
required
The charge amount (in your preferred currency).
properties
object
Optional properties describing the charge.

Examples

// Track a simple charge
Trodo.people.trackCharge(99.99);

// Track with properties
Trodo.people.trackCharge(49.99, {
  plan: 'pro',
  billingCycle: 'monthly',
  currency: 'USD'
});

// Track annual upgrade
Trodo.people.trackCharge(1200, {
  currency: 'USD',
  plan: 'enterprise',
  billingCycle: 'annual'
});

people.clearCharges()

Clear all tracked charges for the user.
Trodo.people.clearCharges()

Example

// Clear charges (e.g., after refund)
Trodo.people.clearCharges();

Reserved Property Names

These property names are reserved and cannot be used:
// ❌ Don't use these
{
  $name,
  $email,
  $charges,
  $phoneno
}

Property Limits

ConstraintLimit
Max properties per user500
Max property key length255 characters
Max string value length255 bytes (UTF-8)
Max object value size256 KB
Max object nesting depth3 levels
See Implementation Guide for complete details.

Complete Example

// On signup
Trodo.identify(user.id);

Trodo.people.set({
  email: user.email,
  plan: 'free'
});

Trodo.people.set_once({
  signupDate: new Date().toISOString(),
  referralSource: utmSource
});

// After meaningful usage
Trodo.people.increment({ successful_runs: 1 });
Trodo.people.union({ enabled_integrations: ['slack', 'notion'] });

// On upgrade
Trodo.people.set({ plan: 'pro' });
Trodo.people.trackCharge(99, {
  plan: 'pro',
  billingCycle: 'annual'
});

// List membership (e.g. tags)
Trodo.people.append({ feature_flags: 'beta_analytics' });
Trodo.people.remove({ feature_flags: 'legacy_ui' });

Identify Users

Link sessions to identities

Groups

Organizations and group profiles

Track Events

Track user actions