PlanSignal — Examples
DATA PLATE
PlanSignal emits plan, billing, and entitlement facts at read time. Your application interprets those facts and executes outcomes elsewhere.
EXAMPLE
// Application-owned outcome example.
// PlanSignal does not grant access or block requests.
// Read-time plan lookup.
const billing = await planSignal.state({
subject: userId,
scope: "account",
});
// Example shape:
// {
// plan: "free" | "standard" | "commercial",
// status: "active" | "past_due" | "canceled",
// entitlements: ["export", "team_access"]
// }
if (billing.status !== "active") {
return rejectFeatureAccess("Account is not active");
}
if (!billing.entitlements.includes("export")) {
return rejectFeatureAccess("Export entitlement not present");
}
return grantExportAccess();Plan state is not authorization. PlanSignal emits facts. Your application owns access control, degraded modes, and user-facing behavior.
RELATED LINKS
-> Spec Sheet [ID: PLN-01]