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.
The Problem
Section titled “The Problem”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 componentsif (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
The Solution
Section titled “The Solution”Presage gives you three primitives:
- A rules engine — declarative conditions with 14 operators, priority ordering, and boolean logic
- Behavioral signals — auto-computed from tracked events (session count, feature usage, click maps)
- User maturity — automatic segmentation into
new,onboarding,active,power, ordormant
These combine into a single UserContext that your UI components can react to.
Who Is This For?
Section titled “Who Is This For?”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/elselogic across components - Don’t want (or can’t afford) an enterprise personalization platform
Key Concepts at a Glance
Section titled “Key Concepts at a Glance”| Concept | Description |
|---|---|
| UserContext | The full picture: traits + signals + maturity |
| Adaptation Point | A place in your UI that can show different variants |
| Rule | A condition-action pair: “if X, show variant Y” |
| Strategy | How variants are selected (rules-based today, bandits coming) |
| Tracker | Records events and feeds the signal computation |
| Persistence | Stores traits and signals across sessions |
Architecture
Section titled “Architecture”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.
Next Steps
Section titled “Next Steps”- 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