Get started2 / 12
Core concepts
Stacked is built from a few ideas. Offers, live ops events and leaderboards are the same loop seen three ways, so once these are clear, each feature is a short read.
The loop
- Your game sends events as players play.
- Each event updates what Stacked knows about the player, and counts toward whatever is listening: an offer's progress, a milestone track, a leaderboard.
- Your game asks Stacked what to show a player.
- The player claims what they have earned.
- Stacked tells your backend with a reward webhook, and your backend grants it.
Your game reports and grants. Stacked decides and keeps count. Nothing in your game's code names a specific offer, so you can change what runs from the dashboard at any time.
Game, Test and Live
A game is one organization in the dashboard, with its own team and roles.
Every game has two environments, switched at the top of the dashboard:
| Test | Live | |
|---|---|---|
| For | Building and trying things out | Real players |
| Credentials | Its own client id and API key | Its own client id and API key |
| Data | Its own players, offers, events and leaderboards | Its own |
| Webhooks | Its own endpoints and secrets | Its own |
Nothing moves from Test to Live by itself. See environments for the URLs.
Players
A player is whoever your game says it is. You choose the id (up to 250 characters), and Stacked creates the player the first time it sees that id.
What Stacked knows about a player is their snapshot. Your events keep it current, and conditions read it.
| Part of the snapshot | Kept current by |
|---|---|
| Username, sign-up date | signIn, signUp |
| Days in game, login streak | signIn |
| Levels | levelUp |
| Currency balances | earnCurrency, spendCurrency |
| Dynamic fields: values of your own | setField, incField |
| Tags | addTags, removeTags, or the dashboard |
| Trust score | trustScore, or the dashboard |
| Achievements, quests, memberships | Their own events |
| Country and network | The address the player's game client calls from |
| Entity kind and links | playerSnapshot, linkUser |
Entities and links. A "player" does not have to be a person. It can be a pet, a guild or a character: give its snapshot an entity kind. Entities can be linked, a pet to its owners, a member to a guild. Links are what let an offer be shared by a team, let a milestone track count by group, and let a signed-in player act for an entity linked to them (targetId on the API).
Events
An event says one thing happened: a sign-in, a purchase, a level gained, a value of your own changed. Your backend sends events with a server SDK.
Two kinds of event are worth knowing by name, because you define them yourself:
- A dynamic field is a named value on a player, such as
boss_kills. Conditions and scoring rules can read it and count changes to it. - A context is a named moment, such as
enter_arena. Calling it can surface offers on the spot.
Events lists them all.
Conditions
A condition is a test on a player. The same tests are used everywhere a feature needs to pick players:
| Used as | Answers |
|---|---|
| A surfacing condition on an offer | Who gets this offer? |
| A completion condition on an offer | Has the player done it? |
| A bucket of a sharded leaderboard | Which shard does this player belong in? |
| A reward rule, a spend limit, a prize boost | Which players does this apply to? |
Offers has the full list.
Scoring rules
A scoring rule turns an event into points: "1 point per gold coin spent", "50 points for each boss kill, once a day". Live ops milestone tracks and leaderboards both score with them. See Scoring rules.
Rewards and claims
A reward is what a player gets: an item, currency, experience. Rewards are claimed, by the player in your game or by your backend for them.
Stacked never changes anything inside your game. A claim makes Stacked send a signed reward webhook to your backend with the player and the rewards, and your backend does the granting.
The three features
| Offers | Live Ops | Leaderboards | |
|---|---|---|---|
| What a player sees | Tasks with rewards | A timed event: milestones, dailies, event offers | A ranking, and their own place in it |
| Who gets it | Players who meet the surfacing conditions | Everyone, or players who reach a context | Everyone, optionally split into shards |
| Progress comes from | Completion conditions | Scoring rules, and showing up each day | Scoring rules |
| Paid when | The player claims | The player claims a milestone or a daily | You generate rewards after it ends |
Words used in these docs
| Word | Meaning |
|---|---|
| Surface | To give an offer or an event to a player. Before that, the player does not have it |
| Instance | One player's copy of an offer, with its own progress, status and instanceId |
| Snapshot | What Stacked knows about a player |
| Dynamic field | A named value of your own on a player |
| Context | A named moment in your game |
| Track | A line of milestones in a live ops event, with its own points |
| Threshold | A point value on a track that unlocks rewards |
| Shard | A group of players who compete on their own copy of a leaderboard |
| Claim | The call that turns earned rewards into a reward webhook |