[DX-1275] guide(store): add project showing how to build dynamic stores - #40
Merged
Conversation
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.
…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
andresfelipemendez
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Server: Some updates are needed on the server too, will be added as separate files that the user is instructed to copy over.