Add XP in an Afternoon: A Low-Maintenance Quickstart with Trophy

Author
Jason Louro
Jason LouroCo-Founder, Trophy

Get XP live in your app by end of day by using Trophy's pre-built points systems. No custom points engine to build or maintain.

Get started · Read the docs

What You Skip by Not Building It Yourself

Building XP in-house means point-inflation tuning, rebalancing award amounts, trigger logic, historical storage, and maintenance that continues indefinitely. Teams that build from scratch spend 3-6 months on implementation plus ongoing upkeep.

Trophy handles the infrastructure. You configure triggers in a dashboard, call one SDK method, and display the result. For the full build-vs-buy breakdown, see How to Build an XP Feature.

Add XP in Three Steps

Step 1: Create the XP System and Configure a Trigger

In the Trophy dashboard, create a points system called "xp" (or any name that fits your product). Add a metric-based trigger that awards XP when users perform an action.

Example trigger configuration:

  • Metric: task_completed
  • Metric threshold: 1 task
  • Points awarded: 10 points

No code deploy required. Change values in the dashboard and they apply immediately.

Step 2: Track an Action and Read the Awarded XP

When a user performs the action, send a metric event to Trophy:

import { TrophyApiClient } from '@trophyso/node';

const trophy = new TrophyApiClient(process.env.TROPHY_API_KEY);

const response = await trophy.metrics.event('task_completed', {
  user: { id: 'user-123' },
  value: 1
});

// XP awarded by this event
const xpAdded = response.points?.xp?.added;
const xpTotal = response.points?.xp?.total;

console.log(`+${xpAdded} XP. Total: ${xpTotal}`);

Trophy checks triggers, awards XP, and returns the result in the same response. No second API call needed.

Step 3: Display the User's Total XP

Fetch the current total for display anywhere in your UI:

const xp = await trophy.users.points('user-123', 'xp');

console.log(`Total XP: ${xp.total}`);

That's it. Three steps, one afternoon.

Why It Stays Low-Maintenance

Dashboard and MCP configuration: Change point values, add triggers, or adjust thresholds without deploying code. Trophy's dashboard and MCP support let you iterate on your XP economy in minutes.

Idempotent, retry-safe API: If a request fails and your system retries, Trophy prevents double-awarding. No custom deduplication logic required.

Rebalancing without disruption: When you adjust point values, new events use new values while existing user XP stays unchanged. No migrations, no angry users.

Get Started

Campfire was set up in about an hour. Lexioo integrated in 3 days. Most teams ship XP in 1 day to 1 week, compared to 3-6 months building from scratch.

Get started free · Points documentation

Author
Jason Louro
Jason LouroCo-Founder, Trophy

Get the latest on gamification

Product updates, best practices, and insights on retention and engagement — delivered straight to your inbox.

The gamification layer for consumer apps

Drop-in gamification features you can ship this sprint. Increase retention and user engagement without sacrificing your roadmap.

Add XP in an Afternoon: A Low-Maintenance Quickstart with Trophy