Skip to main content

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:
See full payload implementation ->

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 = unlimited
int?
Minutes to wait between shows. null = no cooldown
bool
Show immediately when eligible without requiring explicit activation

Multi-surface payloads

One payload can have multiple options for different surfaces:
This lets the same campaign appear as both a popup and a banner, with different rules for each.

Items

Items combine a payload with a specific option:
Items provide derived properties:

Creating items

Convert payloads to items when feeding to engine:

Type aliases

Use type aliases for cleaner code:
See production typedefs ->

Metadata patterns

Campaign metadata

App update metadata

Tip metadata

Best practices

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)
Add fromJson/toJson for Remote Config integration:

Next steps

Slots & State

How items flow through state

Production example

Real-world payload implementation