Overview
Presentum uses three related types to represent presentations:- Payloads - Your domain data (campaigns, tips, updates)
- Options - How payloads appear (surface + variant + rules)
- Items - Concrete decisions (payload + option)
Payloads
Payloads are your domain objects containing all presentation data:Required fields
String
required
Unique identifier for the payload. Used for tracking and deduplication.
int
required
Display priority. Higher priority items shown first. Typical range: 0-1000.
Map<String, Object?>
required
Arbitrary domain data. Store titles, images, URLs, eligibility data, etc.
List<PresentumOption>
required
How this payload can be presented across different surfaces.
Production example
From a real app with JSON deserialization:Options
Options describe how a payload appears on a specific surface:Option fields
S extends PresentumSurface
required
Where this option appears (e.g.,
AppSurface.homeTopBanner)V extends PresentumVisualVariant
required
How this option is displayed (e.g.,
CampaignVariant.banner)bool
required
Whether users can close this presentation
int?
Sequence hint for multi-stage flows (e.g., 0 = fullscreen, 1 = dialog)
int?
Maximum times to show.
null = unlimitedint?
Minutes to wait between shows.
null = no cooldownbool
Show immediately when eligible without requiring explicit activation
Multi-surface payloads
One payload can have multiple options for different surfaces:Items
Items combine a payload with a specific option:Creating items
Convert payloads to items when feeding to engine:Type aliases
Use type aliases for cleaner code:Metadata patterns
Campaign metadata
App update metadata
Tip metadata
Best practices
Use priority ranges
Use priority ranges
Establish priority ranges for different types:
- 0-99: Low priority tips
- 100-199: Regular campaigns
- 200-299: Important updates
- 300+: Critical alerts (maintenance, force updates)
Implement serialization
Implement serialization
Add
fromJson/toJson for Remote Config integration:Next steps
Slots & State
How items flow through state
Production example
Real-world payload implementation