Add a trial
Add a time-limited trial to a paid plan.
Add a time-limited trial to a paid plan.
New subscribers can try a paid plan before normal billing begins.
fs.plan()A trial is a plan kind: fs.plan.kind.trial with lifecycle.trialDays and
the recurring price that applies after the trial. Add it as a sibling of the
paid plan, or convert the paid plan itself:
fs.plan("pro-trial", {
kind: fs.plan.kind.trial,
price: fs.money.usd(49).monthly(),
lifecycle: { trialDays: 14 },
grants: [api],
limits: [requests.perMinute(600)],
});
During the trial no obligation accrues; rating still records the served
context, so a trial with usagePricing rates post-trial use correctly from
the first paid day. Preview the compiled contract:
farthershore build --format json
git push -u origin HEAD:env/trial-preview
farthershore business show acme --env trial-preview --format json
Create a new preview subscription and confirm the returned plan has
kind: "trial" and trial_days: 14. Existing subscriptions are not a
substitute for this test.
PLAN_KIND_CONTROL_MISMATCH: a trial plan requires
price and lifecycle and allows only usagePricing beyond them.Remove the trial plan (or restore the previous kind) and rebuild the preview. If already released, review active trials before releasing another billing change.
See plans, subscriptions, and plan changes.
Add a 14-day trial to the paid
proplan usingfs.plan.kind.trialandlifecycle.trialDays. Treat this as a billing change requiring approval, validate withfarthershore build, test a new preview subscription, and stop before production publish.