Documentation
¶
Overview ¶
Package premium holds what the paid plan costs and where to buy it.
The dashboard has to state a price: a dialog that explains a paid feature and then sends someone away to find out what it costs is asking them to leave in order to be sold to. But a price is also the single most damaging thing to get wrong — a page that says $5 and a card that is charged $6 is how the first ten customers are lost.
It cannot be fetched, either: rule 4 means the dashboard makes no outbound calls, so the figure ships in the binary whatever we do.
So it lives here, once, and `TestPricingMatchesTheSite` in this package reads the site's own pricing file and fails when the two disagree. That turns "two copies that will drift" into "two copies that cannot drift silently" — the check runs in CI, where a mismatch is a red build rather than a support email.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compare ¶ added in v0.34.0
type Compare struct {
// What the plan is called on the vendor's own page.
Plan string `json:"plan"`
// USD per month, billed monthly.
MonthlyUSD float64 `json:"monthly_usd"`
// Where the figure was read, and when. Shown to the user — an unsourced
// number about someone else's pricing is the kind rule 6 exists to stop.
Source string `json:"source"`
ReadOn string `json:"read_on"`
}
Compare is a price someone is already paying, for scale.
Caprock's own price means nothing on its own — $30 is only cheap or dear against something. The thing every user of this dashboard is already paying for is a Claude subscription, so that is the ruler.
It is a quoted price with a source and a date, per rule 6. It is not a claim that the two are substitutes: a Claude plan buys the model, Caprock buys a view of what the model did. The comparison is of magnitude, and the UI has to say so rather than implying an either/or.
type Plan ¶
type Plan struct {
// USD per month. For Yearly this is the yearly price divided by twelve —
// what the plan works out to, which is the number people compare.
PerMonthUSD float64 `json:"per_month_usd"`
// USD actually charged, per billing period.
ChargedUSD float64 `json:"charged_usd"`
// How often ChargedUSD is taken: "month" or "year".
Period string `json:"period"`
// The Stripe payment link. Opened in a new tab; never embedded.
URL string `json:"url"`
}
Plan is what a subscription costs and the Stripe link that sells it.
type Pricing ¶
type Pricing struct {
Yearly Plan `json:"yearly"`
Monthly Plan `json:"monthly"`
Lifetime Plan `json:"lifetime"`
InfoURL string `json:"info_url"`
// Compare is what a Claude Pro subscription costs, for scale.
Compare Compare `json:"compare"`
}
Pricing is every way to buy, plus where to read more.