Skip to main content
Here you’ll integrate your backend web application with Trophy and start building your first gamified feature.
These instructions are for those who want to implement Trophy by hand. If instead you prefer to use coding agents, switch tabs above.
1

Create your Trophy account

First, create a new account if you don’t already have one and head into the Trophy dashboard.Head through onboarding to get your account set up.
2

Add the Trophy SDK to your backend

We have SDK libraries available in most major programming languages but if you don’t see yours listed, let us know and we’ll make one!
npm install @trophyso/node
Alternatively, you can directly call the API using any server-side HTTP client.
3

Set up environment

Head to the integration page of the Trophy dashboard and create a new API key.Add your API key as an environment variable in your backend application:
TROPHY_API_KEY='*******'
Then initialize the Trophy API client in your backend using that API key:
import { TrophyApiClient } from "@trophyso/node";

const trophy = new TrophyApiClient({
  apiKey: process.env.TROPHY_API_KEY as string,
});
Make sure all Trophy SDK calls use this client for authentication.
4

Create your first metric

All gamification features are driven by user interactions. In Trophy, you use Metrics to define and model those interactions and Events to track them.Here you’ll create your first metric to get started. In the Trophy dashboard, head into the metrics page and hit the New Metric button:
Give the metric a name and hit Save.
5

Integrate the metric into your backend

Once you’ve created your metric, head to the configure tab and copy it’s unique API reference key.
To track an event against this metric when a user interacts with your product, call the metric change event API, passing along details of the user that made the interaction. In this example the metric key would be flashcards-flipped:
curl -X POST https://app.trophy.so/api/metrics/flashcards-flipped/event \
     -H "X-API-KEY: <apiKey>" \
     -H "Content-Type: application/json" \
     -d '{
  "user": {
    "id": "18",
    "email": "user@example.com",
    "tz": "Europe/London"
  },
  "value": 750
}'
By making this call, you’re telling Trophy that a specific user made an interaction with your product. As a result, Trophy will process any gamification features like achievements or streaks that you’ve configured against the metric automatically.
6

Continue building your gamification experience

With a metric integrated into your backend, you’re ready to start adding gamification features to your product.Follow the links below to learn more about each feature you can build with Trophy:

Achievements

Reward users for continued progress or taking specific actions.

Streaks

Motivate users to build regular usage habits.

Points

Build sophisticated points systems to reward and retain users.

Leaderboards

Create friendly competitions to increase user engagement.

Emails

Deliver personalized lifecycle emails to users at the perfect moment.

Push Notifications

Drive automated notification flows using personalized gamification data.
Or, explore our API reference to get familiar with what Trophy can do.

Get Support

Want to get in touch with the Trophy team? Reach out to us via email. We’re here to help!