Skip to content

Latest commit

 

History

History
110 lines (84 loc) · 4.55 KB

File metadata and controls

110 lines (84 loc) · 4.55 KB
title Quick Start
description Get up and running with Trophy in under 10 minutes
og:description Follow this quick start guide to integrate Trophy into your backend and add gamified features like achievements and streaks into your app.

import SdkInstallCommand from "/snippets/sdk-install-command.mdx"; import AddEnvVarBlock from "/snippets/add-env-var-block.mdx"; import MetricChangeRequestBlock from "/snippets/metric-change-request-block.mdx"; import MetricChangeResponseBlock from "/snippets/metric-change-response-block.mdx";

Here you'll integrate your backend web application with Trophy and start building your first gamified feature.

First, [create a new account](https://app.trophy.so/sign-up?utm_source=docs&utm_medium=quickstart) if you don't already have one and head into the [Trophy dashboard](https://app.trophy.so).
Head through onboarding to get your account set up.
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!
<SdkInstallCommand />

Alternatively, you can directly call the API using any server-side HTTP library.
Add your API key that you created during onboarding (or [create a new one](https://app.trophy.so/integration)) as an environment variable in your backend application:
<AddEnvVarBlock />

Make sure to pass this API key to the Trophy SDK or to your API client to authenticate.
All gamification features are driven by user interactions. In Trophy, you use [Metrics](/platform/metrics) to define and model those interactions and [Events](/platform/events) to track them.
Here you'll create your first metric to get started. In the Trophy dashboard, head into the [metrics page](https://app.trophy.so/metrics) and hit the _New Metric_ button:

<Frame>
  <video
    autoPlay
    muted
    loop
    playsInline
    className="w-full aspect-video"
    src="../assets/platform/metrics/create_new_metric.mp4"
  ></video>
</Frame>

Give the metric a name and hit _Save_.
Once you've created your metric, head to the configure tab and copy it's unique API reference key.
<Frame>
  <video
    autoPlay
    muted
    loop
    playsInline
    className="w-full aspect-video"
    src="../assets/quick-start/copy_metric_key.mp4"
  ></video>
</Frame>

To track an event against this metric when a user interacts with your product, call the [metric change event API](/api-reference/endpoints/metrics/send-a-metric-change-event), passing along details of the user that made the interaction. In this example the metric key would be `words-written`:

<MetricChangeRequestBlock />

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.
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:

<CardGroup>
  <Card title="Achievements" icon="trophy" href="/platform/achievements">
    Reward users for continued progress or taking specific actions.
  </Card>
  <Card title="Streaks" icon="flame" href="/platform/streaks">
    Motivate users to build regular usage habits.
  </Card>
  <Card title="Points" icon="sparkle" href="/platform/points">
    Build sophisticated points systems to reward and retain users.
  </Card>
  <Card
    title="Leaderboards"
    icon="/icons/leaderboard.svg"
    href="/platform/leaderboards">
    Create friendly competitions to increase user engagement.
  </Card>
  <Card title="Emails" icon="mail" href="/platform/emails">
    Deliver personalized lifecyle emails to users at the perfect moment.
  </Card>
</CardGroup>

Or, explore our [API reference](/api-reference/introduction) 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!