Skip to main content

Documentation

The customer journey

Sign-up, subscriptions and the portal are the customer journey you implement — and what the five gates enforce. Here is how the three pieces fit end to end.

What you implement, and why it matters

Every SaaS on the platform stands up the same journey: a visitor signs up on your site, lands on a plan, and manages everything from a branded portal. You implement it with three SDK clients — and the platform's five gates then enforce it on every request.

The journey and the gates are two halves of one thing. The gates (see Auth & the five gates) check is this caller allowed, on an active plan, with this feature, within quota? — but they have nothing to check until you've built the journey: no user to authenticate, no subscription to require, no plan features to gate. This is the part you build so the gates have something to enforce.

The three steps

  • Sign-up — register the user in your own UI with @egav/signup. This creates the user and their org. See Sign-up & onboarding.
  • Subscriptions — sell and manage plans with @egav/billing. This activates a subscription and, with it, the plan's features and quotas. See Subscriptions & billing.
  • Portal — give customers a branded place to manage profile, billing, support and notifications — fork the starter or embed the SDK pieces. See Customer portal.

How each step feeds a gate

Once the journey is in place, the gates resolve to real answers instead of failing closed:

You implementThe gate it satisfiesBefore you do
Sign-up creates a user + org1 — authenticate: a bearer resolves to an identity401 — no user
A subscription is active3 — require active subscription402 — no plan
The plan grants a feature4 — require feature403 — feature off
The plan sets a quota5 — enforce quotalimit unknown

Gate 2 (permission) comes from authorization roles, not the journey — see Identity & access.

End to end

The whole path, in the order a customer travels it:

journey.tsts
// 1. Pricing page — list the purchasable plans (public, no auth).
const plans = await signup.getPlans();

// 2. Register with the chosen plan, in your own form.
await signup.signUpWithEmail({ email, password, planCode: 'pro' });

// 3. After email verification the user lands authenticated — start billing.
const { checkout_url } = await billing.createCheckout('pro', 'monthly');
if (checkout_url) window.location.assign(checkout_url);

// 4. From here they live in the portal, and every request runs the five gates.

Read the three in order: Sign-up & onboarding → Subscriptions & billing → Customer portal. The gates that enforce the result are in Auth & the five gates; the features they draw on are declared in your manifest, and the plans that bind and price those features are defined in the Control Plane — see Plans, features & quotas.