Skip to content

[DX-1275] guide(store): add project showing how to build dynamic stores - #40

Merged
trandromeda merged 22 commits into
mainfrom
at/dynamic-store-guide
Jul 20, 2026
Merged

[DX-1275] guide(store): add project showing how to build dynamic stores#40
trandromeda merged 22 commits into
mainfrom
at/dynamic-store-guide

Conversation

@trandromeda

Copy link
Copy Markdown
Contributor

Adds guides/DynamicStore, the companion project for the upcoming "Dynamic store pricing and offers with Satori" how-to guide.

Structure. The first commit is an exact copy of the UnityHiroStore sample, which stays untouched as the guide's starting point. Each following commit layers one part of the Satori integration on top, so the diffs against the baseline mirror the guide's steps. Readers download the Store sample and build toward this end state.

What the end state demonstrates:

  • Connecting Hiro's SatoriSystem with the Nakama user ID as the Satori identity, required for server-side personalization to target the player, including session restore validation and re-alignment on account switches.
  • Buying the Starter Pack sets a custom property that ends its intro sale and re-prices it.
  • A scheduled live event that halves item prices via a flag override, with a data-driven banner and countdown that appear only while the event runs.

Server: Some updates are needed on the server too, will be added as separate files that the user is instructed to copy over.

Baseline for the dynamic store pricing and offers guide: an exact copy
of the Store sample's beginning state. Subsequent commits layer the
Satori integration on top, so each shows the guide's changes as a diff
against this baseline.
Register a SatoriSystem alongside the existing Hiro systems, backed by
an authorizer that authenticates with the Nakama user ID as the Satori
identity. The server-side SatoriPersonalizer looks players up in Satori
by Nakama user ID, so any other identity would never receive audience
targeting. Restored sessions are validated by IdentityId, and
AlignSatoriIdentityAsync re-authenticates when the active account
changes.
StoreController takes an optional ISatoriSystem and gains the dynamic
store flows: UpdateSegmentPropertiesAsync (property update with
audience recompute, then store refresh), offer-change detection from
the Hiro-Economy flag's ConditionChanged, seasonal item helpers keyed
on the event_id additional property, live event end-time lookup for
countdowns, and GetOriginalCost for was/now sale pricing, which
StoreItemView renders with a rich-text strikethrough. All Satori
behavior degrades to a no-op when the system is absent, keeping the
existing tests and offline behavior intact. A catalog log on each
refresh shows the merged store the server returned.
AccountSwitcher gains a SessionChangedAsync hook awaited after the
Nakama session changes and before AccountSwitched fires, so the store
refresh that follows a switch always runs with the realigned Satori
identity. StoreViewBehaviour wires the hook to the coordinator's
AlignSatoriIdentityAsync and passes the SatoriSystem into the
controller.
A Seasonal tab appears only while the store contains items in the
seasonal category (delivered by a Satori live event) and exits
gracefully when the event ends. A countdown pill ticks via the UI
Toolkit scheduler, resolving the event schedule through the convention
that the live event is named after the items' event_id property. The
featured slot renders was/now sale prices, and a toast fires once when
the Hiro-Economy flag reports the player's offers changed. The scene
picks up the coordinator's serialized Satori connection fields.
Merges Satori feature flag values (Hiro-Economy and friends) onto the
base Hiro configs per player, enabling audience-based offers and live
events for the DynamicStore guide. PublishAuthenticateEvents also
creates the Satori identity as the Nakama user ID on login, so players
are targetable from their first session. The registration is inert on
deployments without a Satori integration configured, so other samples
sharing this server are unaffected.
@trandromeda trandromeda changed the title Add DynamicStore sample project [DX-1275] guide(store): add how-to project for building dynamic stores Jul 16, 2026
@linear-code

linear-code Bot commented Jul 16, 2026

Copy link
Copy Markdown

DX-1275

@trandromeda trandromeda changed the title [DX-1275] guide(store): add how-to project for building dynamic stores [DX-1275] guide(store): add project showing how to build dynamic stores Jul 16, 2026
trandromeda and others added 8 commits July 16, 2026 13:44
)

* XP Guide

* Code improvements

* Project Rename
…cs (#41)

* Add gacha guide project

* added separator between the ticket sprite and reward previews

---------

Co-authored-by: KikePerez <ekike797@gmail.com>
…tem-templates to examples (#44)

* Update README

* Update guide server folder names

* Rename system-templates to examples
* expand gitignore to look at subfolders

* remove artifacts
@trandromeda
trandromeda merged commit 059c1ad into main Jul 20, 2026
1 check passed
@trandromeda
trandromeda deleted the at/dynamic-store-guide branch July 20, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants