Skip to content

Introduction

Presage is a library for building adaptive user interfaces in SaaS applications. It bridges the gap between raw analytics data and the UI your users see — letting you personalize experiences without an enterprise platform.

Most SaaS apps treat every user identically. A first-time visitor sees the same dashboard as a power user with 500 sessions. When teams do personalize, it looks like this:

// Scattered across dozens of components
if (user.role === 'admin' && user.plan === 'enterprise') {
showAdvancedDashboard()
} else if (user.sessionsCount < 3) {
showOnboarding()
} else {
showDefault()
}

This approach breaks down fast:

  • No single source of truth — conditions are scattered across the codebase
  • No behavioral awareness — you track clicks but never use them to drive the UI
  • Expensive alternatives — enterprise personalization platforms cost six figures and require a data team

Presage gives you three primitives:

  1. A rules engine — declarative conditions with 14 operators, priority ordering, and boolean logic
  2. Behavioral signals — auto-computed from tracked events (session count, feature usage, click maps)
  3. User maturity — automatic segmentation into new, onboarding, active, power, or dormant

These combine into a single UserContext that your UI components can react to.

Presage is designed for SaaS B2B developers who:

  • Want to show different onboarding flows based on user behavior
  • Need to adapt navigation, dashboards, or feature discovery per user segment
  • Are tired of scattering if/else logic across components
  • Don’t want (or can’t afford) an enterprise personalization platform
ConceptDescription
UserContextThe full picture: traits + signals + maturity
Adaptation PointA place in your UI that can show different variants
RuleA condition-action pair: “if X, show variant Y”
StrategyHow variants are selected (rules-based today, bandits coming)
TrackerRecords events and feeds the signal computation
PersistenceStores traits and signals across sessions
Track Events → Compute Signals → Evaluate Rules → Render Variant
↑ ↓
└──────────── Impression Tracking ←──────────────────┘

Presage operates entirely client-side by default, with an optional backend for advanced features. The core is framework-agnostic — React, Vue, and Svelte adapters provide idiomatic bindings.

  • Quick Start — Install and build your first adaptive component in 5 minutes
  • Core Concepts — Deep dive into the building blocks
  • API Reference — Complete type definitions and method signatures