Environments
Two environments, test and live, keep every trial apart from real Customers and real money.
Every Startup has two environments, test and live. Both run one definition; each keeps its own records, money and messages, and the key on a call picks between them.
One definition, two sets of records
A Startup's definition is its Nouns, Verbs, Offers, Pages and code. Both environments read it. Every operational record, such as an Order, a Customer or an Event, belongs to exactly one environment and never crosses.
The two differ in which build they run. test runs the head: the latest merged Change. live runs the Version last deployed.
Merge a new Offer, and it is callable in test at once, while live Customers still see the deployed build. Environments is the capability that keeps the two apart.
The key picks the environment
An sk_test_ key reaches test, and an sk_live_ key reaches live. The URL is the same for both.
curl https: //api.sb/ gradeready.com/ offers -H "Authorization: Bearer sk_test_..."
curl https: //api.sb/ gradeready.com/ offers -H "Authorization: Bearer sk_live_..."No parameter moves a keyed call between environments. Code goes from test to live by changing one variable, STARTUP_BUILDER_API_KEY.
A person signed in to the CLI holds a session that reaches both. It starts in test, and --env live switches one command. Keys lists every kind of key.
What test does differently
test runs every Verb for real, with three exceptions that keep it safe:
In test | What happens instead |
|---|---|
| Payments | Test cards charge, and no money moves |
| Outbound messages | Reach only the Startup's own team, never outside addresses |
| Outside effects | Domain purchases, ad spend and filings are simulated, then recorded as done |
Everything else matches live: Permissions, Limits, Approvals, delay windows, Watches and Events. A refund over its Limit waits for an Approval in test as it would in live. A flow that passes in test passes in live.
Simulated outside effects take magic values that force each outcome, such as a declined card. Errors and testing lists them.
Built in test, by an agent
gradeready.com is an Agent as a Service that gives students line-by-line feedback on essays. An Agent built it from one sentence, entirely in test, before any person looked at it.
In test an agent needs nobody's permission. It defines the Offer, publishes the Site, places Orders as test Customers and handles them end to end. Every step is recorded, so the build is reviewable later.
Money is where a person enters. A sponsor claims the Startup with one link: they verify who they are, connect a payment account and sign. The claim names the owner of record, and from then on the Startup may move real money.
Going live
live serves nothing until the first Version is deployed. Until then, any call with an sk_live_ key returns not-live, status 503.
To go live, deploy a Version. Each later deploy moves live to a new build, and the previous Version stays one revert away.
Records never move between environments. The test Customers and Orders stay in test, and live starts empty. Experiments run only in live, where real Customers decide them.
Next
- Authentication: creating
sk_test_andsk_live_keys. - Errors and testing: a test plan that runs entirely in
test. - Previews: the
tryMode previews a call without recording it, in either environment.